/* RYU Library v6.5.0: coherent cabinet materials for three premium editions.
   A visual-only final cascade. Do not modify book geometry or animations.
   Tones use a single material vocabulary across headings, reading/favorites
   showcases, bookcase header, cabinet frame, shelf backboards and ledges. */

/* One set of furniture tokens, aligned with the studio card editions. */
#ryu-personal-root[data-ryu-shelf-theme="royal-walnut"] {
  --f-wall:#271e22; --f-panel:#30232a; --f-deep:#291c22;
  --f-ink:#f2e8db; --f-muted:#d8c2b4; --f-detail:#ad8a6c;
  --f-edge:#735955; --f-seam:#443039; --f-plinth:#3c2930;
  --f-frame:#35262a; --f-frame-glow:#4c3436;
  --f-back:#342725; --f-back-hi:#46332e;
  --f-ledge-top:#74533f; --f-ledge-mid:#50372b; --f-ledge-base:#2e211e;
  --f-button:#39262d; --f-button-text:#f7ead6;
}
#ryu-personal-root[data-ryu-shelf-theme="midnight-archive"] {
  --f-wall:#172330; --f-panel:#1c2938; --f-deep:#18232f;
  --f-ink:#f0e9de; --f-muted:#d3d5d4; --f-detail:#b2a38c;
  --f-edge:#53606b; --f-seam:#263440; --f-plinth:#27313b;
  --f-frame:#222b33; --f-frame-glow:#38414a;
  --f-back:#202d39; --f-back-hi:#34414c;
  --f-ledge-top:#5b5550; --f-ledge-mid:#393737; --f-ledge-base:#25272b;
  --f-button:#293442; --f-button-text:#f2ebe0;
}
#ryu-personal-root[data-ryu-shelf-theme="heritage-ivory"] {
  --f-wall:#eee4d4; --f-panel:#eae0ce; --f-deep:#e6dac7;
  --f-ink:#35291f; --f-muted:#5e4c3e; --f-detail:#7c644f;
  --f-edge:#c2b099; --f-seam:#d3c3ae; --f-plinth:#c7b7a1;
  --f-frame:#b9aa96; --f-frame-glow:#d7c9b4;
  --f-back:#ddd2c1; --f-back-hi:#ebe2d4;
  --f-ledge-top:#b3a38d; --f-ledge-mid:#917f69; --f-ledge-base:#756550;
  --f-button:#493a2c; --f-button-text:#fff3df;
}

/* The drawing room is ONE cabinet, not blocks painted independently.
   Limit all rules to authenticated personal shelves and nonclassic themes. */
#ryu-personal-root[data-ryu-shelf-theme]:not([data-ryu-shelf-theme="classic"]) {
  color:var(--f-ink)!important;
  --cabinet-panel:var(--f-panel);--cabinet-text:var(--f-ink);
  --cabinet-muted:var(--f-muted);--cabinet-metal:var(--f-edge);
  --cabinet-frame-1:var(--f-frame);--cabinet-frame-2:var(--f-frame-glow);
  --cabinet-back-1:var(--f-back);--cabinet-back-2:var(--f-back-hi);
  --cabinet-shelf-1:var(--f-ledge-top);--cabinet-shelf-2:var(--f-ledge-base);
}
#ryu-personal-root[data-ryu-shelf-theme]:not([data-ryu-shelf-theme="classic"]) .ryu-personal-heading,
#ryu-personal-root[data-ryu-shelf-theme]:not([data-ryu-shelf-theme="classic"]) .ryu-personal-pages {
  background:linear-gradient(125deg,var(--f-panel),var(--f-deep))!important;
  border-color:var(--f-edge)!important;
  color:var(--f-ink)!important;
  box-shadow:none!important;
}
#ryu-personal-root[data-ryu-shelf-theme]:not([data-ryu-shelf-theme="classic"]) .ryu-personal-pages {
  border-top:0!important;
}
#ryu-personal-root[data-ryu-shelf-theme]:not([data-ryu-shelf-theme="classic"]) :is(.ryu-personal-heading h2,.ryu-personal-heading p,.ryu-personal-pages span,.bookcase-number,.bookcase-title,.featured-head,.featured-head span,.featured-label,.ryu-personal-empty,.ryu-personal-recent-card span) {
  color:var(--f-ink)!important;opacity:1!important;text-shadow:none!important;
}
#ryu-personal-root[data-ryu-shelf-theme]:not([data-ryu-shelf-theme="classic"]) :is(.featured-head small,.ryu-reading-position) {
  color:var(--f-muted)!important;opacity:1!important;
}
#ryu-personal-root[data-ryu-shelf-theme]:not([data-ryu-shelf-theme="classic"]) :is(.ryu-personal-heading .ryu-personal-grade,.ryu-personal-heading .ryu-personal-grade *) {
  background:var(--f-button)!important;color:var(--f-button-text)!important;
  border-color:var(--f-detail)!important;opacity:1!important;
}
#ryu-personal-root[data-ryu-shelf-theme]:not([data-ryu-shelf-theme="classic"]) :is(.ryu-personal-actions button,.ryu-personal-pages button,.ryu-reading-featured-item button:not(.featured-card)) {
  background:var(--f-button)!important;color:var(--f-button-text)!important;
  border-color:var(--f-detail)!important;
}
/* TWO showcase trays share one carcase. Remove inherited 14px golden/divergent
   bars; leave only a gentle joining line, like fitted furniture. */
#ryu-personal-root[data-ryu-shelf-theme]:not([data-ryu-shelf-theme="classic"]) .ryu-personal-grid .bookcase-featured {
  background:linear-gradient(116deg,var(--f-wall) 0%,var(--f-panel) 48%,var(--f-wall) 100%)!important;
  color:var(--f-ink)!important;
  border:1px solid var(--f-edge)!important;
  border-bottom:4px solid var(--f-plinth)!important;
  margin:0!important;
  box-shadow:inset 0 1px 0 color-mix(in srgb,var(--f-detail) 18%,transparent)!important;
}
#ryu-personal-root[data-ryu-shelf-theme]:not([data-ryu-shelf-theme="classic"]) .ryu-personal-grid .bookcase-featured + .bookcase-featured {
  border-top:0!important;
}
#ryu-personal-root[data-ryu-shelf-theme]:not([data-ryu-shelf-theme="classic"]) .ryu-personal-grid .featured-head {
  border-bottom-color:color-mix(in srgb,var(--f-edge) 45%,transparent)!important;
}
#ryu-personal-root[data-ryu-shelf-theme]:not([data-ryu-shelf-theme="classic"]) .ryu-personal-grid .bookcase-header {
  background:linear-gradient(120deg,var(--f-deep),var(--f-panel))!important;
  color:var(--f-ink)!important;
  border:1px solid var(--f-edge)!important;
  border-top:0!important;
  border-bottom:0!important;
  box-shadow:none!important;
  margin:0!important;
}
/* The cabinet rail is NOT an ivory-coloured stroke around a navy cabinet. */
#ryu-personal-root[data-ryu-shelf-theme]:not([data-ryu-shelf-theme="classic"]) .ryu-personal-grid .bookcase-frame {
  background:linear-gradient(95deg,var(--f-frame),var(--f-frame-glow) 48%,var(--f-frame))!important;
  border-color:var(--f-frame)!important;
  outline:1px solid var(--f-edge)!important;outline-offset:-2px!important;
  box-shadow:inset 0 0 0 1px var(--f-edge),0 17px 30px #0005!important;
}
#ryu-personal-root[data-ryu-shelf-theme]:not([data-ryu-shelf-theme="classic"]) .ryu-personal-grid .bookcase-frame .shelf-unit,
#ryu-personal-root[data-ryu-shelf-theme]:not([data-ryu-shelf-theme="classic"]) .ryu-personal-grid .bookcase-frame.ryu-spotlight-active .shelf-unit.ryu-shelf-lit {
  background:radial-gradient(ellipse at 50% 82%,color-mix(in srgb,var(--f-detail) 9%,transparent),transparent 76%),linear-gradient(115deg,var(--f-back),var(--f-back-hi) 50%,var(--f-back))!important;
  border-left-color:var(--f-frame)!important;
  border-right-color:var(--f-frame)!important;
}
#ryu-personal-root[data-ryu-shelf-theme]:not([data-ryu-shelf-theme="classic"]) .ryu-personal-grid .bookcase-frame .shelf-unit::after {
  background:linear-gradient(180deg,var(--f-ledge-top),var(--f-ledge-mid) 43%,var(--f-ledge-base) 100%)!important;
  box-shadow:0 8px 11px #0006,inset 0 1px 0 color-mix(in srgb,var(--f-detail) 28%,transparent)!important;
}
/* Harmonize the small captions and the FAVORITES row on inherited CSS. */
#ryu-personal-root[data-ryu-shelf-theme]:not([data-ryu-shelf-theme="classic"]) .ryu-personal-grid :is(.featured-card,.featured-card span,.ryu-fav-featured-wrap span,.ryu-reading-featured-item span) {
  color:var(--f-ink);opacity:1;
}
/* Accessible focus stays highly visible without thick, permanent borders. */
#ryu-personal-root[data-ryu-shelf-theme]:not([data-ryu-shelf-theme="classic"]) :is(button,a):focus-visible {
  outline:2px solid var(--f-detail)!important;outline-offset:3px!important;
}

/* Make the existing one-click palette sync discoverable in the journal editor. */
.ryu-records-dialog[data-ryu-journal-theme^="premium-"] #rr-theme-match-all {
  background:var(--ryu-chip)!important;color:var(--ryu-text)!important;
  border:1px solid var(--ryu-line)!important;font-weight:650;
}
.ryu-records-dialog[data-ryu-journal-theme^="premium-"] #rr-theme-match-all:hover {
  box-shadow:0 0 0 2px color-mix(in srgb,var(--ryu-metal) 48%,transparent);
}
