.tij-shelf-app {
  --tij-accent: #e08a2e;
  --tij-heading-color: var(--tij-text);
  --tij-subheading-color: var(--tij-text);
  --tij-text: var(--e-global-color-text, #f3ecdf);
  --tij-head-font: var(--e-global-typography-primary-font-family, Georgia), Georgia, serif;
  --tij-body-font: var(--e-global-typography-text-font-family, "Trebuchet MS"), "Segoe UI", sans-serif;
  --hand-font: "Caveat", cursive;
  --wood-hi: #9a6c3c;
  --wood-mid: #7a5230;
  --wood-lo: #4a3018;
  --cavity: #17100a;
  --paper: #f3ecdf;
  --ink: #221b14;
  --denim: #2e4156;
  --brass-hi: #ecd49a;
  --brass-lo: #a3803c;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.012 0.13' numOctaves='3' seed='7'/><feColorMatrix type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0.6 0.2 0.1 0 0'/></filter><rect width='220' height='220' filter='url(%23g)' opacity='0.5'/></svg>");
  --paper-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='p'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3'/><feColorMatrix type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0.35 0.35 0.35 0 0'/></filter><rect width='160' height='160' filter='url(%23p)' opacity='0.25'/></svg>");
  color: var(--tij-text);
  font-family: var(--tij-body-font);
  padding: 40px 0 70px;
}

.tij-shelf-app *,
.tij-shelf-app *::before,
.tij-shelf-app *::after {
  box-sizing: border-box;
}

.tij-shelf-app .shelf-wrap {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 16px;
}

.tij-shelf-app .shelf-header {
  text-align: center;
  margin-bottom: 26px;
}

.tij-shelf-app .shelf-header h1 {
  margin: 0;
  color: var(--tij-heading-color) !important;
  font-family: var(--tij-head-font);
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  font-weight: normal;
  letter-spacing: 0;
}

.tij-shelf-app .shelf-header p {
  max-width: 560px;
  margin: 10px auto 0;
  color: var(--tij-subheading-color) !important;
  font-size: .95rem;
  opacity: .82;
}

.tij-shelf-app .shelf-subheading-secondary {
  margin-top: 12px;
  font-size: .86rem;
}

.tij-shelf-app .toolbar {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.tij-shelf-app button,
.tij-shelf-app a {
  font-family: var(--tij-body-font);
}

.tij-shelf-app .toolbar button {
  font-size: .8rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .07);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .18);
  outline: 2px dashed var(--tij-accent);
  outline-offset: -6px;
  border-radius: 4px 4px 14px 14px;
  padding: 10px 18px 12px;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}

.tij-shelf-app .toolbar button:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, .14);
}

.tij-shelf-app .toolbar button[aria-pressed="true"],
.tij-shelf-app .toolbar .help-btn {
  background: var(--tij-accent);
  color: var(--ink);
  outline-color: rgba(34, 27, 20, .75);
  border-color: transparent;
  font-weight: 700;
}

.tij-shelf-app .picker,
.tij-shelf-app .tray {
  max-width: 700px;
  margin: 20px auto 26px;
  background: var(--paper-grain), linear-gradient(180deg, #faf5ea, var(--paper));
  color: var(--ink);
  border-radius: 8px;
  border: 2px dashed var(--tij-accent);
  outline: 6px solid var(--paper);
  padding: 20px 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

.tij-shelf-app .picker[hidden],
.tij-shelf-app .tray[hidden],
.tij-shelf-app [hidden] {
  display: none !important;
}

.tij-shelf-app .picker h2 {
  font-family: var(--tij-head-font);
  font-size: 1.15rem;
  margin: 0 0 4px;
}

.tij-shelf-app .picker .sub,
.tij-shelf-app .picker .hint {
  color: #6b5d49;
  font-size: .82rem;
}

.tij-shelf-app .q {
  margin-top: 14px;
}

.tij-shelf-app .q-label {
  display: block;
  margin-bottom: 6px;
  color: #6b5d49;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.tij-shelf-app .opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tij-shelf-app .opts button {
  background: #fff;
  color: var(--ink);
  border: 1px solid #cdbfa4;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
}

.tij-shelf-app .opts button[aria-pressed="true"] {
  background: var(--tij-accent);
  color: var(--ink);
  border-color: var(--tij-accent);
}

.tij-shelf-app .tray h2 {
  margin: 0 0 10px;
  font-family: var(--hand-font);
  font-size: 1.6rem;
  transform: rotate(-1deg);
}

.tij-shelf-app .tray ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tij-shelf-app .tray li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed #cdbfa4;
}

.tij-shelf-app .tray li:last-child {
  border-bottom: none;
}

.tij-shelf-app .t-title {
  font-family: var(--tij-head-font);
  font-size: .95rem;
}

.tij-shelf-app .t-why {
  flex: 1;
  color: #6b5d49;
  font-size: .8rem;
  font-style: italic;
}

.tij-shelf-app .t-view,
.tij-shelf-app .tray-reset {
  cursor: pointer;
}

.tij-shelf-app .t-view {
  background: var(--tij-accent);
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.tij-shelf-app .tray-reset {
  margin-top: 12px;
  background: none;
  border: 0;
  color: #6b5d49;
  text-decoration: underline;
}

.tij-shelf-app .bookcase {
  position: relative;
  min-height: 220px;
  margin-top: 22px;
  padding: 20px 26px 24px;
  background:
    var(--grain),
    linear-gradient(90deg, var(--wood-lo) 0, var(--wood-hi) 3%, var(--wood-mid) 8%, var(--wood-mid) 92%, var(--wood-hi) 97%, var(--wood-lo) 100%);
  border-radius: 6px;
  box-shadow:
    0 2px 3px rgba(255, 255, 255, .12) inset,
    0 -3px 8px rgba(0, 0, 0, .45) inset,
    0 18px 28px -10px rgba(0, 0, 0, .55),
    0 40px 80px -20px rgba(0, 0, 0, .5);
}

.tij-shelf-app .bookcase::before {
  content: "";
  position: absolute;
  left: -8px;
  right: -8px;
  top: -14px;
  height: 18px;
  background: var(--grain), linear-gradient(180deg, var(--wood-hi), var(--wood-mid) 60%, var(--wood-lo));
  border-radius: 4px 4px 2px 2px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, .4), 0 1px 0 rgba(255, 255, 255, .18) inset;
}

.tij-shelf-app .shelf-row {
  margin-bottom: 4px;
}

.tij-shelf-app .brass-plate {
  display: inline-block;
  position: relative;
  z-index: 1;
  margin: 10px 0 0 10px;
  padding: 5px 16px;
  color: #3a2c10;
  background: linear-gradient(170deg, var(--brass-hi) 0%, #d4b066 35%, var(--brass-lo) 80%, #c9a35a 100%);
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 -1px 2px rgba(0, 0, 0, .35) inset, 0 2px 4px rgba(0, 0, 0, .5);
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .45);
}

.tij-shelf-app .bay {
  position: relative;
  margin-top: 8px;
  padding: 26px 14px 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% -30%, rgba(255, 255, 255, .10), transparent 55%),
    linear-gradient(180deg, #0d0a06 0%, var(--cavity) 30%, #221709 100%);
  border-radius: 2px;
  box-shadow:
    inset 0 14px 22px -8px rgba(0, 0, 0, .9),
    inset 10px 0 16px -10px rgba(0, 0, 0, .85),
    inset -10px 0 16px -10px rgba(0, 0, 0, .85);
}

.tij-shelf-app .shelf-items {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  min-height: 200px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 6px 0;
  scrollbar-width: thin;
}

.tij-shelf-app .plank {
  position: relative;
  height: 15px;
  margin: 0 -26px;
  background: var(--grain), linear-gradient(180deg, #b08454 0%, var(--wood-mid) 30%, var(--wood-lo) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 6px 12px -2px rgba(0, 0, 0, .55);
}

.tij-shelf-app .spine {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  background-color: var(--sc);
  color: var(--st);
  cursor: pointer;
  transform: rotate(var(--tilt, 0deg));
  transform-origin: bottom center;
  transition: transform .18s ease, opacity .25s ease, filter .25s ease;
}

.tij-shelf-app .spine:hover,
.tij-shelf-app .spine:focus-visible {
  z-index: 4;
  transform: rotate(var(--tilt, 0deg)) translateY(-12px);
}

.tij-shelf-app .spine.book {
  isolation: isolate;
  border-radius: 2px 2px 1px 1px;
  background-image:
    var(--paper-grain),
    linear-gradient(90deg, rgba(0, 0, 0, .50) 0%, rgba(255, 255, 255, .22) 9%, rgba(255, 255, 255, .05) 22%, rgba(0, 0, 0, .10) 55%, rgba(0, 0, 0, .42) 100%);
  box-shadow: -4px 8px 10px -4px rgba(0, 0, 0, .75), 0 1px 0 rgba(255, 255, 255, .12) inset;
}

.tij-shelf-app .spine.book::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 3px;
  right: 3px;
  height: 5px;
  background: repeating-linear-gradient(90deg, #efe6d2 0 2px, #d9cdb2 2px 3px);
  border-radius: 2px 2px 0 0;
  box-shadow: 0 -1px 1px rgba(0, 0, 0, .3);
  z-index: 0;
}

.tij-shelf-app .spine.book.bands::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 14%;
  height: 72%;
  background: linear-gradient(180deg, transparent 0 6%, rgba(255, 255, 255, .16) 6% 7.5%, rgba(0, 0, 0, .28) 7.5% 9%, transparent 9% 91%, rgba(255, 255, 255, .16) 91% 92.5%, rgba(0, 0, 0, .28) 92.5% 94%, transparent 94%);
  pointer-events: none;
  z-index: 0;
}

.tij-shelf-app .spine.deck {
  border-radius: 3px;
  background-image:
    var(--paper-grain),
    linear-gradient(115deg, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .08) 18%, transparent 35%, rgba(0, 0, 0, .18) 100%);
  box-shadow: -4px 8px 10px -4px rgba(0, 0, 0, .75), 0 0 0 2px rgba(255, 255, 255, .15) inset, 0 1px 0 rgba(255, 255, 255, .25) inset;
}

.tij-shelf-app .spine.deck::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, .28);
  pointer-events: none;
}

.tij-shelf-app .spine.photo {
  background: #111;
  overflow: hidden;
}

.tij-shelf-app .spine.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tij-shelf-app .spine .label {
  position: relative;
  z-index: 2;
  display: block;
  max-height: 90%;
  overflow: hidden;
  color: var(--st);
  font-family: var(--tij-head-font);
  font-size: .7rem;
  letter-spacing: .04em;
  text-overflow: ellipsis;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .55), 0 -1px 0 rgba(255, 255, 255, .12);
  white-space: nowrap;
  writing-mode: vertical-rl;
}

.tij-shelf-app .spine.book .label {
  position: absolute;
  top: 12px;
  bottom: 10px;
  left: 50%;
  z-index: 5;
  display: block;
  width: 1.4em;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  color: var(--st, #f7e4be) !important;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: translateX(-50%);
  -webkit-text-fill-color: currentColor !important;
  background: none !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .8);
  filter: none;
}

.tij-shelf-app .spine.deck .label {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 58px;
  writing-mode: vertical-rl;
}

.tij-shelf-app .spine.foil .label {
  color: #f2dc9b;
  background: linear-gradient(160deg, #f7e7b0 15%, #b98e3e 40%, #f2dc9b 55%, #8d6a28 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6));
}

.tij-shelf-app .spine.book.foil .label {
  color: var(--st, #f2dc9b) !important;
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
}

.tij-shelf-app .pip {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 1.1em;
}

.tij-shelf-app .talker {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 8;
  width: 88px;
  padding: 5px 7px;
  background: #fff8df;
  color: #4d3a28;
  border: 1px dashed var(--tij-accent);
  border-radius: 2px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .35);
  font-family: var(--hand-font);
  font-size: .9rem;
  line-height: .95;
  transform: translateX(-50%) rotate(-3deg);
  pointer-events: none;
}

.tij-shelf-app .badge-own,
.tij-shelf-app .badge-want {
  position: absolute;
  top: -11px;
  right: -7px;
  z-index: 6;
  min-width: 24px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--tij-accent);
  color: var(--ink);
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .04em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}

.tij-shelf-app .badge-want {
  background: var(--paper);
}

.tij-shelf-app .bookcase.picks-active .spine {
  opacity: .22;
  filter: saturate(.35) brightness(.7);
}

.tij-shelf-app .bookcase.picks-active .spine.picked {
  z-index: 3;
  opacity: 1;
  filter: none;
  transform: rotate(var(--tilt, 0deg)) translateY(-12px);
  box-shadow: 0 0 0 2px var(--tij-accent), 0 0 22px 2px rgba(224, 138, 46, .55), -4px 8px 10px -4px rgba(0, 0, 0, .75) !important;
}

.tij-shelf-app .disclosure {
  margin: 14px 0 0;
  text-align: center;
  font-size: .72rem;
  opacity: .7;
}

.tij-shelf-app .overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(10, 7, 4, .72);
}

.tij-shelf-app .overlay.open {
  display: flex;
}

.tij-shelf-app .card {
  position: relative;
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  background: var(--paper-grain), linear-gradient(180deg, #fbf5e8, var(--paper));
  color: var(--ink);
  border: 2px dashed var(--tij-accent);
  border-radius: 8px;
  outline: 6px solid var(--paper);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .65);
}

.tij-shelf-app .close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--tij-accent);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0;
}

.tij-shelf-app .card-body {
  display: grid;
  grid-template-columns: minmax(220px, 330px) 1fr;
  gap: 26px;
  padding: 28px;
}

.tij-shelf-app .cover-frame {
  position: relative;
}

.tij-shelf-app .cover {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 26px;
  background-position: center;
  background-size: cover;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18), 0 12px 28px rgba(0, 0, 0, .32);
  color: var(--paper);
  font-family: var(--tij-head-font);
  font-size: 1.25rem;
  text-align: center;
}

.tij-shelf-app .cover span {
  writing-mode: vertical-rl;
}

.tij-shelf-app .g-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 34px;
  height: 44px;
  transform: translateY(-50%);
  border: 0;
  background: rgba(0, 0, 0, .48);
  color: #fff;
  cursor: pointer;
  font-size: 1.8rem;
}

.tij-shelf-app .g-arrow.prev {
  left: 6px;
}

.tij-shelf-app .g-arrow.next {
  right: 6px;
}

.tij-shelf-app .thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tij-shelf-app .thumbs button {
  width: 48px;
  height: 48px;
  border: 2px solid transparent;
  background-position: center;
  background-size: cover;
  cursor: pointer;
}

.tij-shelf-app .thumbs button[aria-current="true"] {
  border-color: var(--tij-accent);
}

.tij-shelf-app .meta h2 {
  margin: 0;
  padding-right: 44px;
  font-family: var(--tij-head-font);
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: normal;
  line-height: 1.15;
}

.tij-shelf-app .author {
  margin-top: 4px;
  color: #6b5d49;
}

.tij-shelf-app .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0;
}

.tij-shelf-app .tags span {
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #d5c8ad;
  color: #5b4c3b;
  font-size: .74rem;
}

.tij-shelf-app .desc {
  color: #32271d;
  line-height: 1.58;
}

.tij-shelf-app .buy {
  display: inline-block;
  margin: 10px 0 14px;
  padding: 10px 18px;
  background: var(--tij-accent);
  color: var(--ink);
  border-radius: 4px 4px 14px 14px;
  outline: 2px dashed var(--ink);
  outline-offset: -5px;
  font-weight: 700;
  text-decoration: none;
}

.tij-shelf-app .blurb {
  margin: 0 0 14px;
  color: #6b5d49;
  font-family: var(--hand-font);
  font-size: 1.35rem;
  line-height: 1.05;
}

.tij-shelf-app .shelf-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tij-shelf-app .shelf-toggles button {
  padding: 8px 14px;
  border: 1px solid #cdbfa4;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.tij-shelf-app .shelf-toggles button[aria-pressed="true"] {
  background: var(--tij-accent);
  color: var(--ink);
  border-color: var(--tij-accent);
}

.tij-shelf-app .login-prompt,
.tij-shelf-app .collector-note,
.tij-shelf-app .more-from-me,
.tij-shelf-app .editions {
  margin-top: 14px;
  padding: 12px 14px;
  background: #fdf8ec;
  border: 1px dashed var(--tij-accent);
  border-radius: 6px;
}

.tij-shelf-app .lp-actions,
.tij-shelf-app [data-mfm-links] {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tij-shelf-app .lp-actions a,
.tij-shelf-app [data-mfm-links] a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 4px 4px 12px 12px;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 700;
}

.tij-shelf-app .lp-register,
.tij-shelf-app [data-mfm-links] a {
  background: var(--tij-accent);
  color: var(--ink);
}

.tij-shelf-app .lp-login {
  background: var(--tij-accent);
  color: var(--ink);
}

.tij-shelf-app .cn-label,
.tij-shelf-app .mfm-label,
.tij-shelf-app .editions-label {
  display: block;
  margin-bottom: 6px;
  color: #6b5d49;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.tij-shelf-app .edition-entry {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #cdbfa4;
}

.tij-shelf-app .edition-entry:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.tij-shelf-app .edition-entry h3 {
  margin: 0 0 4px;
  font-family: var(--tij-head-font);
  font-size: 1rem;
}

.tij-shelf-app .edition-entry p {
  margin: 0;
  color: #54483a;
  font-size: .88rem;
  line-height: 1.45;
}

.tij-shelf-app .empty-state {
  margin: 0;
  padding: 42px 20px;
  text-align: center;
  color: rgba(255, 255, 255, .82);
}

@media (max-width: 760px) {
  .tij-shelf-app {
    padding-top: 24px;
  }

  .tij-shelf-app .bookcase {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tij-shelf-app .card-body {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .tij-shelf-app .cover {
    min-height: 280px;
  }

  .tij-shelf-app .tray li {
    flex-wrap: wrap;
  }

  .tij-shelf-app .t-view {
    width: 100%;
  }
}
