/* RYU 6.4.6 | three coordinated physical-card palettes, scoped to member surfaces. */
.ryu-records-dialog[data-ryu-journal-theme^="premium-"]{
 --j-ink:#f5e8d4;--j-gold:#d7b678;--j-paper:#2d1a24;--j-edge:#89674d;--j-muted:#d7bd9d;
 border-color:var(--j-gold);background:var(--j-paper);color:var(--j-ink)
}
.ryu-records-dialog[data-ryu-journal-theme="premium-velvet"]{--j-paper:#2b1923;--j-ink:#f5e8d4;--j-gold:#d7b678;--j-edge:#846246;--j-muted:#d2bba3}
.ryu-records-dialog[data-ryu-journal-theme="premium-nocturne"]{--j-paper:#142337;--j-ink:#f2ebdd;--j-gold:#d8bd88;--j-edge:#8f795b;--j-muted:#c7c9ca}
.ryu-records-dialog[data-ryu-journal-theme="premium-ivory"]{--j-paper:#eee1c9;--j-ink:#302419;--j-gold:#765334;--j-edge:#9c7853;--j-muted:#68513c}
.ryu-records-dialog[data-ryu-journal-theme^="premium-"] .rr-shell{background:radial-gradient(circle at 83% 5%,color-mix(in srgb,var(--j-gold) 12%,transparent),transparent 52%),var(--j-paper);color:var(--j-ink)}
.ryu-records-dialog[data-ryu-journal-theme^="premium-"] :is(.rr-header,.rr-top){border-color:color-mix(in srgb,var(--j-gold) 38%,transparent);color:var(--j-ink)}
.ryu-records-dialog[data-ryu-journal-theme^="premium-"] :is(.rr-header h2,.rr-header p,.rr-eyebrow,.rr-top span,.rr-paper h3,.rr-stat strong,.rr-grade-badge,.rr-stat span,.rr-cover-caption,.rr-cover-caption strong,.rr-profile .rr-identity h3){color:var(--j-ink)!important}
.ryu-records-dialog[data-ryu-journal-theme^="premium-"] :is(.rr-paper,.rr-stat){background:color-mix(in srgb,var(--j-paper) 76%,var(--j-gold) 24%);border-color:color-mix(in srgb,var(--j-edge) 70%,transparent);color:var(--j-ink)}
.ryu-records-dialog[data-ryu-journal-theme="premium-ivory"] :is(.rr-stat,.rr-paper){background:#e6d5b8}
.ryu-records-dialog[data-ryu-journal-theme^="premium-"] :is(.rr-paper p,.rr-paper small,.rr-muted,.rr-cover-caption small,.rr-identity dt,.rr-identity dd,.rr-premium-small){color:var(--j-muted)!important}
.ryu-records-dialog[data-ryu-journal-theme="premium-ivory"] :is(.rr-paper p,.rr-paper small,.rr-muted,.rr-identity dt,.rr-identity dd,.rr-premium-small){color:#61482f!important}
.ryu-records-dialog[data-ryu-journal-theme="premium-ivory"] .rr-grade-badge{background:#3d2a21!important;color:#ffedcc!important;border:1px solid #a47d53!important;box-shadow:0 2px 9px #2c201333;white-space:nowrap}
.ryu-records-dialog[data-ryu-journal-theme="premium-ivory"] .rr-grade-badge *{color:#ffedcc!important}
.ryu-records-dialog[data-ryu-journal-theme="premium-ivory"] .rr-premium-seal{color:#ffedcc!important;background:#4d2c36!important;border-color:#8e6d4a!important}
.ryu-records-dialog[data-ryu-journal-theme^="premium-"] .rr-profile {color:var(--j-ink)!important}
.ryu-records-dialog[data-ryu-journal-theme^="premium-"] .rr-paper :is(input:not([type=checkbox]),select){color:#f9e8cc;background:#23212a}
.ryu-records-dialog[data-ryu-journal-theme="premium-ivory"] .rr-paper :is(input:not([type=checkbox]),select){color:#39281e;background:#fff9ee}
/* Use the exact PRINT SVG, not a second certificate-themed approximation. */
.ryu-records-dialog .rr-profile-cert.rr-real-card-mini{background:transparent!important;border:0!important;padding:0!important;min-height:0!important;box-shadow:none!important;gap:4px;align-self:center;overflow:visible}
.ryu-records-dialog .rr-real-card-mini .rr-mini-card-art {display:block;width:100%;aspect-ratio:9/5;box-shadow:0 10px 28px #0008;overflow:hidden;border-radius:5px;transition:transform .18s}
.ryu-records-dialog .rr-real-card-mini:hover .rr-mini-card-art{transform:translateY(-3px)}
.ryu-records-dialog .rr-real-card-mini svg{display:block;width:100%;height:100%;object-fit:contain}
.ryu-records-dialog .rr-real-card-mini .rr-mini-card-caption{color:var(--j-ink,#efd8b7)!important;font-size:11px;word-break:break-all}
.rr-cert-actions button[aria-pressed="true"]{background:#ae8a59;color:#221917;border-color:#e6c18d}
.rr-3d-explainer{color:#e8d3b1;font-size:14px;text-align:center;margin:6px 0 20px}
.rr-3d-explainer small{display:block;opacity:.7;font-size:11px;margin:7px 0}
.rr-3d-scene{perspective:1350px;margin:0 auto;width:min(100%,820px);aspect-ratio:9/5;cursor:pointer;outline-offset:6px}
.rr-3d-card{position:relative;width:100%;height:100%;transform-style:preserve-3d;transition:transform .85s cubic-bezier(.2,.8,.2,1);box-shadow:0 12px 36px #0005;border-radius:8px}
.rr-3d-scene.is-flipped .rr-3d-card{transform:rotateY(180deg)}
.rr-3d-face{position:absolute;inset:0;backface-visibility:hidden;-webkit-backface-visibility:hidden;overflow:hidden;border-radius:8px;border:1px solid #ccb18b55;background:#20191b}
.rr-3d-face svg{width:100%;height:100%;display:block}
.rr-3d-back{transform:rotateY(180deg)}
.rr-3d-card-number{text-align:center;font-size:15px;letter-spacing:.09em;color:#e2c796;overflow-wrap:anywhere}
/* Personal shelf uses a coherent FRAME, HEADER and LEDGE palette, not just an isolated backboard. */
#ryu-personal-root[data-ryu-shelf-theme="royal-walnut"]{--s-accent:#caac7b;--s-panel:#372028;--s-ledge:#69432a}
#ryu-personal-root[data-ryu-shelf-theme="midnight-archive"]{--s-accent:#d5b984;--s-panel:#172b40;--s-ledge:#564b3e}
#ryu-personal-root[data-ryu-shelf-theme="heritage-ivory"]{--s-accent:#71563c;--s-panel:#e8dbc1;--s-ledge:#61442a}
#ryu-personal-root[data-ryu-shelf-theme="heritage-ivory"] .ryu-personal-grid .bookcase-frame{background:linear-gradient(115deg,#a98a61,#eadbc1 30%,#b59b7a);border-color:#795636;box-shadow:inset 0 0 0 2px #c6a77c,0 25px 39px #0007}
#ryu-personal-root[data-ryu-shelf-theme="heritage-ivory"] .ryu-personal-grid .bookcase-frame .shelf-unit{background:repeating-linear-gradient(90deg,#00000008 0px,#fff9ee22 9px,#00000008 21px),linear-gradient(115deg,#d6c4a5,#efe2cd,#cdb18e)!important}
#ryu-personal-root[data-ryu-shelf-theme!="classic"] :is(.ryu-personal-heading,.ryu-personal-top,.ryu-personal-case-header,.ryu-personal-bookcase-label){border-color:var(--s-accent)!important}
#ryu-personal-root[data-ryu-shelf-theme!="classic"] :is(.ryu-personal-header,.ryu-personal-section,.ryu-personal-book-row){background-color:var(--s-panel)}
#ryu-personal-root[data-ryu-shelf-theme="heritage-ivory"] :is(.ryu-personal-header,.ryu-personal-section,.ryu-personal-book-row){color:#38291b}
.ryu-records-dialog .rr-shelf-backdrop-heritage-ivory .rr-shelf-backdrop-swatch{background:linear-gradient(115deg,#d6c4a5,#efe2cd,#a98a61)}
/* Lounge document/reader should have consistent readable contrast on actual narrow drawer. */
#library-drawer .ryu-v644-discussion-card{min-width:0;max-width:100%;box-sizing:border-box}
@media(max-width:650px){.rr-cert-actions{justify-content:center}.rr-cert-actions button{flex:1 1 120px}.rr-3d-explainer{font-size:12px}.ryu-records-dialog .rr-profile:has(.rr-real-card-mini){grid-template-columns:minmax(82px,100px) minmax(0,1fr)}.ryu-records-dialog .rr-profile-cert.rr-real-card-mini{grid-column:1/-1;width:min(100%,400px);justify-self:center}}
@media(prefers-reduced-motion:reduce){.rr-3d-card{transition:none}}
.ryu-records-dialog[data-ryu-journal-theme="premium-ivory"] .rr-profile[data-profile-theme="premium-ivory"] .rr-grade-badge{
 background:#392820!important;color:#fce9c5!important;border:1px solid #9f774e!important;letter-spacing:.04em;white-space:nowrap;opacity:1!important
}
.ryu-records-dialog[data-ryu-journal-theme="premium-ivory"] .rr-profile[data-profile-theme="premium-ivory"] .rr-grade-badge .rr-books,
.ryu-records-dialog[data-ryu-journal-theme="premium-ivory"] .rr-profile[data-profile-theme="premium-ivory"] .rr-grade-badge .rr-books *{
 color:#e2c08f!important;opacity:1!important
}
/* 3D controls live outside the card perspective; ample space prevents rotated card overlap. */
.rr-premium-certificate-dialog .rr-cert-actions{margin-top:23px;justify-content:center}
.rr-premium-certificate-dialog .rr-cert-heading span{max-width:75%}
/* Real personal-shelf DOM contracts: featured stands / shelf header / frame share an edition. */
#ryu-personal-root[data-ryu-shelf-theme!="classic"] .ryu-personal-heading,
#ryu-personal-root[data-ryu-shelf-theme!="classic"] .ryu-personal-pages,
#ryu-personal-root[data-ryu-shelf-theme!="classic"] .ryu-personal-grid .bookcase-featured,
#ryu-personal-root[data-ryu-shelf-theme!="classic"] .ryu-personal-grid .bookcase-header{
 background:var(--s-panel)!important;border-color:var(--s-accent)!important;
}
#ryu-personal-root[data-ryu-shelf-theme!="classic"] .ryu-personal-grid .featured-head{border-bottom-color:var(--s-accent)!important}
#ryu-personal-root[data-ryu-shelf-theme!="classic"] .ryu-personal-grid .bookcase-frame .shelf-unit::after,
#ryu-personal-root[data-ryu-shelf-theme!="classic"] .ryu-personal-grid .bookcase-frame .shelf-unit::before{
 background:linear-gradient(180deg,color-mix(in srgb,var(--s-ledge) 72%,#e2bb7c),var(--s-ledge))!important;
}
#ryu-personal-root[data-ryu-shelf-theme="heritage-ivory"] :is(.ryu-personal-heading h2,.ryu-personal-heading p,.ryu-personal-pages,.bookcase-header .bookcase-title,.bookcase-header .bookcase-number,.featured-head){color:#322418!important}
#ryu-personal-root[data-ryu-shelf-theme="heritage-ivory"] .ryu-personal-grade{color:#ffedce!important;background:#36261d!important;border-color:#947047!important}
