.mobile-shelves-archive-btn,
.mobile-shelves-more,
.mobile-create-shelf,
.mobile-shelf-menu,
.mobile-shelf-swipe-hint {
  display: none;
}

@media (max-width: 700px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow-x: clip;
  }

  body {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .app-site-return {
    position: relative;
    right: auto;
    bottom: auto;
    width: fit-content;
    max-width: calc(100% - 24px);
    margin: 8px 12px 0;
    padding: 4px;
    box-sizing: border-box;
  }

  .app-site-return a {
    display: grid;
    place-items: center;
    min-height: 44px;
    padding: 4px 10px;
  }

  .mobile-shelves-header {
    position: sticky;
    top: 0;
    z-index: 40;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding: 10px 0 12px !important;
    background: rgba(12, 11, 10, 0.96) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(18px);
  }

  .mobile-shelves-header-inner {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding: 0 12px !important;
  }

  .mobile-shelves-top-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    min-width: 0;
    margin-bottom: 8px !important;
    gap: 8px;
  }

  .mobile-shelves-top-row > h1 {
    display: none !important;
  }

  .mobile-shelves-left {
    display: grid !important;
    grid-template-columns: auto minmax(132px, 1fr);
    align-items: center;
    min-width: 0;
    gap: 8px !important;
  }

  .mobile-shelves-left > :first-child {
    min-width: 66px;
  }

  .mobile-shelves-left > :first-child > :first-child {
    display: none;
  }

  .mobile-shelves-left > :first-child span:first-of-type {
    font-size: 7px !important;
  }

  .mobile-shelves-left > :first-child span:last-of-type {
    font-size: 10px !important;
  }

  .mobile-shelves-view-switch {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    min-width: 0;
    padding: 3px !important;
  }

  .mobile-shelves-view-switch button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    padding: 5px 7px !important;
    font-size: 9px !important;
  }

  .mobile-shelves-actions {
    display: flex !important;
    align-items: center;
    width: auto;
    min-width: 0;
    gap: 5px !important;
  }

  .mobile-shelves-actions > :not(.mobile-shelves-archive-btn):not(.mobile-shelves-more) {
    display: none !important;
  }

  .mobile-shelves-archive-btn,
  .mobile-shelves-more {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    color: #d4af37;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 999px;
    font: 800 13px/1 var(--font-sans);
    cursor: pointer;
  }

  .mobile-shelves-more {
    position: relative;
  }

  .mobile-shelves-more > summary {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    list-style: none;
    cursor: pointer;
  }

  .mobile-shelves-more > summary::-webkit-details-marker,
  .mobile-shelf-menu > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-shelves-more-sheet {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 90;
    display: grid;
    width: min(260px, calc(100vw - 24px));
    padding: 8px;
    gap: 6px;
    background: #151310;
    border: 1px solid rgba(212, 175, 55, 0.38);
    border-radius: 10px;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.55);
  }

  .mobile-shelves-more-sheet button,
  .mobile-shelf-menu-sheet button {
    min-height: 44px;
    padding: 8px 10px;
    color: #f1ede4;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    font: 700 11px/1.2 var(--font-sans);
    text-align: left;
    cursor: pointer;
  }

  .mobile-shelves-hero {
    padding: 3px 0 9px !important;
  }

  .mobile-shelves-hero h1,
  .mobile-shelves-header h1 {
    font-size: 38px !important;
    line-height: 1 !important;
  }

  .mobile-shelves-hero p {
    font-size: 8px !important;
    letter-spacing: 0.3em !important;
  }

  .mobile-shelves-search-row,
  .mobile-shelves-search-row form {
    width: 100%;
    max-width: none !important;
  }

  .mobile-shelves-search-row {
    display: block !important;
  }

  .mobile-shelves-search-row form > div {
    padding: 8px 11px !important;
    border-radius: 12px !important;
  }

  .mobile-shelves-search-input {
    min-width: 0;
    min-height: 44px;
    font-size: 16px !important;
  }

  .mobile-original-curate {
    display: none !important;
  }

  .mobile-create-shelf {
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin-top: 7px;
    padding: 8px 12px;
    color: #0c0b0a;
    background: #d4af37;
    border: 0;
    border-radius: 9px;
    font: 800 11px/1.2 var(--font-sans);
    cursor: pointer;
  }

  .mobile-create-shelf.is-visible {
    display: flex;
  }

  .mobile-duplicate-curate {
    display: none !important;
  }

  main {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding-top: 26px !important;
    overflow-x: clip;
  }

  main > .flex.flex-col {
    gap: 44px !important;
  }

  .mobile-shelf-section {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding-left: 12px !important;
    padding-right: 12px !important;
    overflow: visible;
  }

  .mobile-shelf-heading-row {
    position: relative;
    display: block !important;
    width: 100%;
    min-width: 0;
  }

  .mobile-shelf-heading-row h2 {
    max-width: 100%;
    padding-right: 52px;
    font-size: 25px !important;
    line-height: 1.16 !important;
    overflow-wrap: anywhere;
  }

  .mobile-original-shelf-action {
    display: none !important;
  }

  .mobile-shelf-menu {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
  }

  .mobile-shelf-menu > summary {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    list-style: none;
    color: #d4af37;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 999px;
    font-size: 16px;
    cursor: pointer;
  }

  .mobile-shelf-menu-sheet {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 60;
    display: grid;
    width: 190px;
    padding: 7px;
    gap: 5px;
    background: #151310;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 9px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.52);
  }

  .mobile-shelf-menu-sheet button:last-child {
    color: #fda4af;
  }

  .mobile-book-interactive {
    outline: none;
  }

  .mobile-book-interactive:focus-visible {
    outline: 3px solid #d4af37;
    outline-offset: 3px;
  }

  .mobile-stack-book {
    min-height: 48px;
  }

  .mobile-book-scroller {
    max-width: 100%;
    padding-right: 48px !important;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 16px;
    overscroll-behavior-x: contain;
  }

  .mobile-book-scroller > * {
    scroll-snap-align: start;
  }

  .mobile-shelf-swipe-hint {
    align-items: center;
    justify-content: space-between;
    margin: 5px 0 0;
    color: rgba(255, 255, 255, 0.48);
    font: 700 9px/1.2 var(--font-sans);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .mobile-book-scroller + .mobile-shelf-swipe-hint {
    display: flex;
  }

  .mobile-shelf-swipe-hint button {
    display: grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    color: #d4af37;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 999px;
    font-size: 20px;
    cursor: pointer;
  }

  .mobile-shelf-swipe-status {
    flex: 1;
    text-align: center;
  }

  #root .fixed.bottom-0.pointer-events-none {
    display: none;
  }
}

@media (max-width: 350px) {
  .mobile-shelves-header-inner {
    padding: 0 8px !important;
  }

  .mobile-shelves-left {
    grid-template-columns: minmax(0, 1fr);
  }

  .mobile-shelves-left > :first-child {
    display: none !important;
  }

  .mobile-shelves-actions {
    gap: 3px !important;
  }

  .mobile-shelves-archive-btn,
  .mobile-shelves-more {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }
}
