/* Shared scoped Detail design extracted from proven local preview; category palette is profile-owned. */
.cd-detail { --cd-detail-accent:#333333; --cd-detail-rule:var(--cd-detail-accent); color:var(--cd-detail-text, #252525); background:var(--cd-detail-surface, #fafafa); font:18px/1.55 Arial,Helvetica,sans-serif; }
.cd-detail *,.cd-detail *::before,.cd-detail *::after { box-sizing:border-box; }
.cd-detail a { color:var(--cd-detail-link, #1742a6); text-underline-offset:3px; }
.cd-detail a:visited { color:var(--cd-detail-link, #1742a6); }
.cd-detail a:focus-visible,.cd-detail summary:focus-visible { outline:3px solid var(--cd-detail-link, #1742a6); outline-offset:4px; }
.cd-detail h1,.cd-detail h2,.cd-detail h3 { font-family:Georgia,'Times New Roman',serif; color:var(--cd-detail-heading, #202020); font-weight:600; line-height:1.15; overflow-wrap:anywhere; }
.cd-detail h2 { font-size:clamp(30px,3.4vw,42px); margin:0; }
.cd-detail .cd-d-hero { display:grid; grid-template-columns:minmax(0,1fr); min-height:var(--cd-detail-hero-desktop,420px); background:var(--cd-detail-accent); isolation:isolate; }
.cd-detail .cd-d-hero-media,.cd-detail .cd-d-hero-copy { grid-area:1/1; min-width:0; }
.cd-detail .cd-d-hero-media { min-height:0; contain:size; }
.cd-detail .cd-d-hero-media picture { display:block; width:100%; height:100%; }
.cd-detail .cd-d-hero-media img { display:block; width:100%; height:100%; object-fit:cover; object-position:center; }
.cd-detail .cd-d-hero-copy { z-index:1; width:100%; max-width:1184px; margin:0 auto; padding:42px 36px 84px; align-self:start; color:#fff; text-shadow:0 2px 4px #000b; }
.cd-detail .cd-d-hero h1 { margin:0; color:#fff; font-size:clamp(44px,5.9vw,76px); line-height:1.08; letter-spacing:-.025em; font-weight:500; }
.cd-detail .cd-d-breadcrumbs { font-size:15px; font-weight:600; margin:0 0 34px; overflow-wrap:anywhere; }
.cd-detail .cd-d-breadcrumbs ol { display:flex; flex-wrap:wrap; gap:9px; padding:0; margin:0; list-style:none; }
.cd-detail .cd-d-breadcrumbs li+li::before { content:'›'; margin-right:9px; color:#fff; }
.cd-detail .cd-d-breadcrumbs a,.cd-detail .cd-d-breadcrumbs a:visited { color:#fff; text-decoration:none; }
.cd-detail .cd-d-rule { display:block; width:88px; height:5px; margin:16px 0 18px; background:var(--cd-detail-rule); }
.cd-detail .cd-d-hero .cd-d-rule { width:100px; margin:18px 0 14px; }
.cd-detail .cd-d-subtitle { color:#fff; font-size:clamp(19px,2.2vw,28px); font-style:italic; line-height:1.35; margin:0; max-width:880px; }
.cd-detail .cd-d-nohero-message { margin:14px 0 0; font-size:14px; }
.cd-detail .cd-d-actions-wrap { position:relative; z-index:2; max-width:1184px; margin:-38px auto 0; padding:0 36px; }
.cd-detail .cd-d-actions { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); min-height:76px; margin:0; padding:8px; background:#fff; border:1px solid #dadada; border-radius:12px; box-shadow:0 7px 18px #15151526; }
.cd-detail .cd-d-action { position:relative; display:flex; align-items:center; justify-content:center; gap:12px; padding:14px 18px; min-width:0; min-height:58px; font-size:17px; font-weight:700; color:var(--cd-detail-text, #252525); text-decoration:none; text-align:center; overflow-wrap:anywhere; }
.cd-detail .cd-d-action:visited { color:var(--cd-detail-text, #252525); }
.cd-detail .cd-d-action+.cd-d-action::before { content:''; position:absolute; left:0; top:18%; bottom:18%; width:1px; background:#dadada; }
.cd-detail .cd-d-action-primary,.cd-detail .cd-d-action-primary:visited { color:#fff; background:var(--cd-detail-accent); border:1px solid var(--cd-detail-accent); border-radius:7px; }
.cd-detail .cd-d-icon { display:block; flex:0 0 28px; width:28px; height:28px; color:var(--cd-detail-accent); }
.cd-detail .cd-d-action-primary .cd-d-icon { color:#fff; }
.cd-detail .cd-d-shell { max-width:1184px; padding:42px 36px 36px; margin:0 auto; background:transparent; }
.cd-detail .cd-d-content { min-width:0; }
.cd-detail .cd-d-with-facts { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); align-items:start; gap:40px; }
.cd-detail .cd-d-description { min-width:0; }
.cd-detail .cd-d-description>h2 { font-family:Georgia,'Times New Roman',serif; font-weight:700; font-size:clamp(31px,3.5vw,43px); line-height:1.1; letter-spacing:-.015em; }
.cd-detail .cd-d-description>.cd-d-rule { width:96px; height:6px; margin:14px 0 18px; }
.cd-detail .cd-d-summary { max-width:64ch; font:500 19px/1.52 system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif; letter-spacing:-.005em; }
.cd-detail .cd-d-summary.cd-detail-copy p { margin-bottom:18px; }
.cd-detail-copy { min-width:0; overflow-wrap:anywhere; }
.cd-detail .cd-detail-copy p { margin:0 0 16px; }
.cd-detail .cd-d-summary p:last-child { margin-bottom:0; }
.cd-detail .cd-detail-copy h2,.cd-detail .cd-detail-copy h3 { margin:24px 0 14px; font-size:26px; }
.cd-detail .cd-detail-copy img { max-width:100%; height:auto; }
.cd-detail .cd-detail-copy table { display:block; max-width:100%; overflow:auto; }
.cd-detail .cd-d-more { margin-top:18px; border-top:1px solid #dadada; font-size:16px; }
.cd-detail .cd-d-more summary { min-height:44px; padding:12px 0; cursor:pointer; font-weight:600; color:var(--cd-detail-accent); }
.cd-detail .cd-d-more .cd-detail-copy { padding:8px 0 10px; }
.cd-detail .cd-d-facts { padding:20px 24px; border:1px solid #dadada; border-radius:12px; background:var(--cd-detail-panel, #f1f1f1); }
.cd-detail .cd-d-facts h2 { margin:0 0 14px; font-family:Georgia,'Times New Roman',serif; font-weight:700; font-size:34px; line-height:1.1; letter-spacing:-.015em; }
.cd-detail .cd-d-facts h2::after { content:''; display:block; width:88px; height:6px; margin-top:10px; background:var(--cd-detail-rule); }
.cd-detail .cd-d-facts dl { margin:0; }
.cd-detail .cd-d-facts dl>div { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:8px; padding:10px 0; }
.cd-detail .cd-d-facts dl>div+div { border-top:1px solid #dadada; }
.cd-detail .cd-d-facts dl>div:last-child { padding-bottom:0; }
.cd-detail .cd-d-facts dt { display:flex; align-items:center; gap:10px; margin:0; font-size:16px; font-weight:700; line-height:1.4; }
.cd-detail .cd-d-facts dt span::after { content:':'; }
.cd-detail .cd-d-facts dd { margin:0; font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif; font-size:17px; font-weight:500; line-height:1.45; overflow-wrap:anywhere; }
.cd-detail .cd-d-facts .cd-d-icon { flex-basis:31px; width:31px; height:31px; color:var(--cd-detail-accent); }
.cd-detail .cd-d-gallery-section { margin-top:30px; }
.cd-detail .cd-d-gallery { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.cd-detail .cd-d-gallery figure { min-width:0; margin:0; }
.cd-detail .cd-d-gallery-media { aspect-ratio:3/2; overflow:hidden; border-radius:10px; background:var(--cd-detail-panel, #f1f1f1); }
.cd-detail .cd-d-gallery-media a,.cd-detail .cd-d-gallery-media picture { display:block; width:100%; height:100%; }
.cd-detail .cd-d-gallery-media img { display:block; width:100%; height:100%; object-fit:cover; border:0; border-radius:0; }
.cd-detail .cd-d-gallery figcaption { padding:8px 3px; font-size:14px; color:var(--cd-detail-muted, #555555); }
.cd-detail .cd-d-cta { display:grid; grid-template-columns:44px minmax(0,1fr) auto; align-items:center; gap:20px; margin-top:30px; padding:22px 28px; border:1px solid #101010dc; border-radius:12px; background:var(--cd-detail-panel, #f1f1f1); }
.cd-detail .cd-d-cta>.cd-d-icon { width:44px; height:44px; }
.cd-detail .cd-d-cta>div { min-width:0; }
.cd-detail .cd-d-cta h2 { margin:0; color:var(--cd-detail-heading, #202020); font:750 28px/1.16 system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif; letter-spacing:-.01em; }
.cd-detail .cd-d-cta p { margin:6px 0 0; font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif; font-size:17px; font-weight:500; line-height:1.45; }
.cd-detail .cd-d-button,.cd-detail .cd-d-button:visited { display:inline-flex; align-items:center; justify-content:center; gap:12px; padding:14px 24px; min-height:52px; min-width:0; max-width:360px; background:var(--cd-detail-accent); color:#fff; border:1px solid var(--cd-detail-accent); border-radius:7px; text-decoration:none; font-size:17px; font-weight:700; line-height:1.35; text-align:center; overflow-wrap:anywhere; }
.cd-detail .cd-d-sr { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.cd-detail .cd-d-separator { border:0; border-top:1px solid #dadada; margin:24px 0; }
@media(min-width:601px) and (max-width:1000px){
 .cd-detail .cd-d-hero { min-height:360px; }
 .cd-detail .cd-d-hero-copy { padding:30px 24px 72px; }
 .cd-detail .cd-d-hero h1 { font-size:clamp(42px,6.6vw,64px); }
 .cd-detail .cd-d-breadcrumbs { margin-bottom:26px; }
 .cd-detail .cd-d-actions-wrap { padding:0 24px; margin-top:-30px; }
 .cd-detail .cd-d-actions { grid-auto-flow:row; grid-template-columns:repeat(2,minmax(0,1fr)); }
 .cd-detail .cd-d-action { min-height:54px; }
 .cd-detail .cd-d-action:nth-child(odd)::before { display:none; }
 .cd-detail .cd-d-shell { padding:34px 24px; }
 .cd-detail .cd-d-with-facts { grid-template-columns:minmax(0,1fr); gap:24px; }
 .cd-detail .cd-d-gallery { grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
 .cd-detail .cd-d-cta { grid-template-columns:36px minmax(0,1fr) auto; gap:16px; padding:20px; }
 .cd-detail .cd-d-cta>.cd-d-icon { width:36px; height:36px; }
 .cd-detail .cd-d-cta h2 { font-size:25px; }
 .cd-detail .cd-d-button { max-width:270px; }
}
@media(max-width:600px){
 .cd-detail .cd-d-hero { min-height:var(--cd-detail-hero-phone,320px); }
 .cd-detail .cd-d-hero-copy { padding:24px 20px 64px; }
 .cd-detail .cd-d-breadcrumbs { margin:0 0 24px; font-size:13px; }
 .cd-detail .cd-d-hero h1 { font-size:clamp(34px,8.7vw,46px); line-height:1.08; }
 .cd-detail .cd-d-hero .cd-d-rule { width:76px; height:4px; margin:14px 0 12px; }
 .cd-detail .cd-d-subtitle { font-size:19px; }
 .cd-detail .cd-d-actions-wrap { margin-top:-22px; padding:0 16px; }
 .cd-detail .cd-d-actions { grid-auto-flow:row; grid-template-columns:minmax(0,1fr); padding:6px; min-height:0; }
 .cd-detail .cd-d-action { min-height:48px; padding:11px 14px; }
 .cd-detail .cd-d-action+.cd-d-action::before { display:none; }
 .cd-detail .cd-d-action+.cd-d-action { border-top:1px solid #dadada; }
 .cd-detail .cd-d-shell { padding:30px 20px; }
 .cd-detail h2 { font-size:31px; }
 .cd-detail .cd-d-description>h2 { font-size:31px; line-height:1.12; }
 .cd-detail .cd-d-summary { font-size:18px; line-height:1.55; max-width:none; }
 .cd-detail .cd-d-with-facts { display:block; }
 .cd-detail .cd-d-facts { margin-top:26px; padding:22px; }
 .cd-detail .cd-d-facts h2 { font-size:30px; }
 .cd-detail .cd-d-facts dl>div { display:block; }
 .cd-detail .cd-d-facts dd { margin:3px 0 0 41px; }
 .cd-detail .cd-d-gallery { grid-template-columns:minmax(0,1fr); gap:16px; }
 .cd-detail .cd-d-cta { grid-template-columns:36px minmax(0,1fr); gap:14px; margin-top:24px; padding:20px; }
 .cd-detail .cd-d-cta>.cd-d-icon { width:36px; height:36px; }
 .cd-detail .cd-d-cta h2 { font-size:25px; }
 .cd-detail .cd-d-cta .cd-d-button { grid-column:1/-1; display:flex; width:100%; max-width:none; }
}

/* T-038: shared native gallery dialog. Existing Detail typography/layout rules stay unchanged. */
.cdx-gallery-dialog { position:fixed; inset:0; box-sizing:border-box; margin:0; border:0; padding:20px 72px; width:100%; max-width:none; height:100%; height:100dvh; max-height:none; background:#15151526; color:#fff; overflow:auto; font:16px/1.4 system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; }
.cdx-gallery-dialog[open] { display:grid; grid-template-rows:auto minmax(0,1fr) auto; gap:12px; }
.cdx-gallery-dialog::backdrop { background:#dadada; }
.cdx-gallery-tools { display:flex; justify-content:flex-end; min-height:48px; }
.cdx-gallery-dialog button { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; min-width:48px; min-height:48px; padding:0; border:1px solid #ffffff70; border-radius:50%; color:#fff; background:#15151526; font:400 42px/1 system-ui,sans-serif; cursor:pointer; }
.cdx-gallery-dialog button[hidden] { display:none; }
.cdx-gallery-dialog button:hover { background:#dadada; border-color:#fff; }
.cdx-gallery-dialog button:focus-visible,.cdx-gallery-dialog a:focus-visible { outline:3px solid #fff; outline-offset:4px; }
.cdx-gallery-image { display:grid; place-items:center; min-width:0; min-height:0; width:100%; height:100%; touch-action:pan-y pinch-zoom; }
.cdx-gallery-image picture { display:contents; }
.cdx-gallery-image img { display:block; width:auto; height:auto; max-width:100%; max-width:min(1360px,100%); max-height:calc(100vh - 160px); max-height:min(100%,calc(100dvh - 160px)); object-fit:contain; border:0; border-radius:0; }
.cdx-gallery-status { margin:0; min-width:0; text-align:center; color:#fff; overflow-wrap:anywhere; }
.cd-detail .cdx-gallery-status a,.cd-detail .cdx-gallery-status a:visited,.cdx-gallery-status a { color:#fff; text-decoration:underline; }
.cdx-gallery-prev,.cdx-gallery-next { position:absolute; top:50%; transform:translateY(-50%); }
.cdx-gallery-prev { left:12px; }
.cdx-gallery-next { right:12px; }
@media(max-width:600px){
 .cdx-gallery-dialog { padding:12px 16px; gap:8px; }
 .cdx-gallery-image img { max-height:calc(100vh - 150px); max-height:min(100%,calc(100dvh - 150px)); }
 .cdx-gallery-prev { left:3px; }
 .cdx-gallery-next { right:3px; }
 .cdx-gallery-status { font-size:14px; }
}

/* T-039: optional decorative background below the hero; no selected image is implied. */
.cd-detail .cd-d-page-area { position:relative; display:flow-root; isolation:isolate; background:var(--cd-detail-surface, #fafafa); }
.cd-detail .cd-d-background { position:absolute; inset:0; z-index:-1; overflow:hidden; pointer-events:none; background:var(--cd-detail-surface, #fafafa); }
.cd-detail .cd-d-background picture { display:contents; }
.cd-detail .cd-d-background img { display:block; width:100%; height:100%; object-fit:cover; object-position:top center; opacity:.16; }

/* T-040: full phone viewer canvas; desktop/tablet rules above remain unchanged. */
.cd-detail [data-cdx-detail-section] { scroll-margin-top:96px; }
.cd-detail span[data-cdx-detail-section] { display:block; height:0; padding:0; border:0; margin:0; }
@media (max-width:600px), (max-width:1000px) and (max-height:600px) and (hover:none) and (pointer:coarse) {
 .cdx-gallery-dialog { padding:8px; padding-top:max(8px,env(safe-area-inset-top)); padding-right:max(8px,env(safe-area-inset-right)); padding-bottom:max(8px,env(safe-area-inset-bottom)); padding-left:max(8px,env(safe-area-inset-left)); }
 .cdx-gallery-dialog[open] { grid-template-rows:minmax(0,1fr); gap:0; }
 .cdx-gallery-image { grid-area:1/1; width:100%; height:100%; }
 .cdx-gallery-image img { width:100%; height:100%; max-width:100%; max-height:100%; object-fit:contain; }
 .cdx-gallery-tools { position:absolute; top:max(4px,env(safe-area-inset-top)); right:max(4px,env(safe-area-inset-right)); z-index:3; }
 .cdx-gallery-dialog button { min-width:48px; min-height:48px; background:transparent; border:0; padding:0; }
 .cdx-gallery-dialog button:hover { background:transparent; }
 .cdx-gallery-dialog button span { display:grid; place-items:center; width:28px; height:28px; border-radius:50%; background:#15151526; font-size:26px; line-height:1; }
 .cdx-gallery-dialog .cdx-gallery-prev span,.cdx-gallery-dialog .cdx-gallery-next span { font-size:30px; }
 .cdx-gallery-prev { left:max(4px,env(safe-area-inset-left)); z-index:2; }
 .cdx-gallery-next { right:max(4px,env(safe-area-inset-right)); z-index:2; }
 .cdx-gallery-status { position:absolute; bottom:max(4px,env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); width:max-content; max-width:calc(100% - 112px); padding:2px 6px; border-radius:4px; background:#15151526; font-size:12px; }
}
