/* D2a card detail (loaded after layout.css). Hero, value, actions, copies, story, grown-up tools.
   Two columns >=1180 with sticky art; one stacked column below (iPad portrait and phones). */
#app.page-card .cd-back{display:inline-block;margin:0 0 6px}
#app.page-card .cd-layout{display:block}
#app.page-card .cd-main{display:flex;flex-direction:column;gap:14px;min-width:0}
#app.page-card .cd-main>*{margin:0}

/* art: glow frame, sticky on wide screens */
.cd-art{padding:14px;text-align:center}
.cd-art-frame{display:grid;place-items:center;padding:10px;border-radius:18px;background:radial-gradient(circle at 50% 40%,#27e1d122,transparent 70%);box-shadow:var(--cb-glow-owned,0 0 26px #27e1d188)}
.cd-art .detail-photo{display:block;width:auto;max-width:100%;max-height:min(70vh,560px);border-radius:10px;margin:0 auto}
.cd-sides{display:inline-flex;margin:12px auto 0;border:1px solid var(--cb-border,#43d7f460);border-radius:999px;overflow:hidden}
.cd-sides[hidden]{display:none}
.cd-sides button{border:0;border-radius:0;min-width:84px;background:transparent}
.cd-sides button[aria-pressed=true]{background:var(--cb-teal-500,#13c4b8);color:#03231f}
.cd-art .thumbs{justify-content:center;gap:6px}
.cd-art .thumbs .photo-original{font-size:12px;padding:4px 8px}
.cd-art .thumbs button:not(.photo-original){width:52px;height:68px;padding:2px}
.cd-art .thumbs img{max-height:100%;object-fit:cover}

/* hero: name block and value together */
.cd-hero{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:8px 16px;padding:0}
.cd-hero h1{font-size:clamp(34px,4.2vw,52px);line-height:1.02;margin:2px 0 4px}
.cd-titles{min-width:0;flex:1 1 280px}
.cd-meta{margin:0 0 6px;font-size:17px}
.cd-rarity{display:inline-flex;align-items:center;gap:8px;padding:3px 12px 3px 8px;border-radius:999px;background:#ffffff14;border:1px solid var(--cb-border,#43d7f450);font-weight:700;font-size:14px}
.cd-rarity-sym svg{display:block;height:20px;width:auto}
.cd-badges{gap:6px;align-self:flex-start}
.cd-value{display:flex;flex-wrap:wrap;align-items:center;gap:4px 22px;padding:16px 20px;background:var(--cb-panel-light,#f6fbff);color:var(--cb-text-dark,#092446);border-radius:16px;border:2px solid #27e1d1}
.cd-value p{color:inherit;margin:0}
.cd-value-label{flex:0 0 100%;font-size:13px;letter-spacing:.08em;text-transform:uppercase;font-weight:800;color:#2a6a84}
.cd-price{font-family:var(--font-display,Georgia,serif);font-size:clamp(44px,6vw,68px);line-height:1;font-weight:700;color:#05325c}
.cd-price.cd-unknown{color:#6b8aa0}
.cd-value-note{flex:1 1 220px;font-size:15px}
.cd-value-warn{flex:0 0 100%;font-weight:700;color:#8a4b00}
.cd-next{flex:1 1 260px;display:grid;gap:4px;justify-items:start}
.cd-next strong{font-size:20px}
.cd-next p{font-size:15px}

/* primary actions: big, at most three */
.cd-actions{display:flex;flex-wrap:wrap;gap:10px}
.cd-actions>*,.cd-take{min-height:54px;padding:10px 22px;font-size:18px;font-weight:800;border-radius:14px;display:inline-flex;align-items:center;justify-content:center;gap:10px}
.cd-actions>[hidden]{display:none}
.cd-actions .cd-take{flex:1 1 240px}
.cd-actions:empty{display:none}

/* your copies */
.cd-section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 8px}
.cd-section-head h2{margin:0;font-size:24px}
.cd-copies .cd-copy-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px;margin:0 0 10px}
.cd-copy-cards button{display:grid;grid-template-columns:44px minmax(0,1fr) auto;align-items:center;gap:10px;text-align:left;padding:8px 10px;border-radius:14px}
.cd-copy-cards button[aria-pressed=true]{border-color:#27e1d1;box-shadow:var(--cb-glow-cyan,0 0 16px #27e1d155)}
.cd-copy-thumb{width:44px;height:60px;object-fit:cover;border-radius:5px;display:grid;place-items:center;background:#ffffff12}
.cd-copy-text{display:grid;gap:1px;min-width:0}
.cd-copy-text small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cd-copy-card{padding:12px 16px}
.cd-copy-card h3{margin:0}
.cd-copy-card p{margin:4px 0}
.cd-copy-actions{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
.cd-copy-actions button{font-size:14px;padding:6px 12px;min-height:0}
.cd-copy-actions:empty{display:none}
.cd-copy-card .copy-facts{margin:8px 0 0}
.selected-copy-panel{display:grid;gap:12px}
.selected-copy-panel>.copy{display:grid;gap:12px}
.selected-copy-panel>.copy.hidden{display:none}

/* story timeline */
.cd-story{padding:14px 18px}
.cd-timeline{list-style:none;margin:0;padding:0}
.cd-timeline>li{position:relative;display:grid;grid-template-columns:36px minmax(0,1fr);gap:12px;padding-bottom:14px}
.cd-timeline>li:not(:last-child)::before{content:"";position:absolute;left:17px;top:36px;bottom:0;width:2px;background:var(--cd-line,#43d7f455)}
.cd-ico{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:#8b5cf6;color:#fff;font-weight:800;font-size:17px}
[data-kind="Lost"] .cd-ico,[data-kind="Stolen"] .cd-ico{background:#e5484d}
[data-kind="Found"] .cd-ico,[data-kind="Added"] .cd-ico{background:#2fb36d}
[data-kind="Traded"] .cd-ico,[data-kind="Lent"] .cd-ico,[data-kind="Returned"] .cd-ico{background:#3b82f6}
[data-kind="Gifted"] .cd-ico{background:#ec6aa6}
[data-kind="Sold"] .cd-ico,[data-kind="Damaged"] .cd-ico{background:#d99a1e}
.cd-body{display:grid;gap:1px;align-content:center;min-width:0}
.cd-body strong{font-size:17px}
.cd-body small{color:var(--cb-muted,#8eabc5)}
.cd-body p{margin:2px 0 0}
.cd-earlier details{grid-column:1/-1}
.cd-earlier summary{cursor:pointer;font-weight:700}
.cd-photo-links{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0}
.cd-photo-links button{font-size:13px;padding:4px 10px;min-height:0}

/* price details (existing evidence panels, kept below the story) */
.cd-price-details{display:grid;gap:12px}
.cd-price-details>.panel,.cd-price-details>section{margin:0}
.cd-price-details .copy-value-layout{display:grid;gap:12px}

/* grown-up tools */
.cd-more{border:1px dashed var(--cb-border,#43d7f460);border-radius:14px;padding:0}
.cd-more>summary{display:flex;align-items:baseline;gap:10px;cursor:pointer;padding:12px 16px;font-weight:800;font-size:17px}
.cd-more>summary small{font-weight:600;color:var(--cb-muted,#8eabc5)}
.cd-more-body{display:grid;gap:14px;padding:4px 16px 16px}
.cd-tool-group h3{margin:0 0 6px;font-size:15px;text-transform:uppercase;letter-spacing:.06em;color:var(--cb-muted,#8eabc5)}
.cd-tool-group .flex{gap:8px;flex-wrap:wrap}
.cd-copy-tools.hidden{display:none}
.cd-more #identity-history{margin:0}

/* two columns at >=1180: art left and sticky, everything else right */
@media(min-width:1180px){
 #app.page-card .split.card-detail-layout.cd-layout{display:grid;grid-template-columns:minmax(300px,380px) minmax(0,1fr);gap:22px;align-items:start}
 #app.page-card .split.card-detail-layout.cd-layout>.card-viewer{position:sticky;top:12px}
}
/* iPad portrait and below: the art becomes a stacked hero */
@media(min-width:760px) and (max-width:1179px){
 #app.page-card .split.card-detail-layout.cd-layout{display:block}
 #app.page-card .split.card-detail-layout.cd-layout>.card-viewer{position:static;margin-bottom:14px;padding:14px}
 .cd-art .detail-photo{max-height:420px}
}
@media(max-width:759px){
 #app.page-card .split.card-detail-layout.cd-layout>.card-viewer{position:static;margin-bottom:12px}
 .cd-art .detail-photo{max-height:360px}
 .cd-actions>*{flex:1 1 100%}
 .cd-value{padding:14px}
}

/* overrides of older generic rules */
#app.page-card .card-value-section.cd-price-details{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
#app.page-card .selected-copy-panel{background:none;border:0;box-shadow:none;padding:0}
#app.page-card .cd-price-details .copy-value-layout{grid-column:auto}
