/* 18318 — Phone route layouts. Desktop/reader geometry stays in its own files. */
.reading-calendar-disclosure { min-width:0; }
.reading-calendar-disclosure > summary {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  min-height:44px; padding:0 12px; color:var(--text); font-size:13px;
  font-weight:700; cursor:pointer; list-style:none;
}
.reading-calendar-disclosure > summary::-webkit-details-marker { display:none; }
.reading-calendar-disclosure[open] > summary span { transform:rotate(180deg); }

html.shortbook-phone-ui .route-view {
  min-height:0; padding-top:22px; padding-bottom:24px;
}
html.shortbook-phone-ui .route-view .route-page-head {
  align-items:flex-start; flex-direction:column; gap:12px;
  margin:0 0 18px; padding:0 0 16px;
}
html.shortbook-phone-ui .route-page-head h1 {
  font-family:inherit; font-size:25px; line-height:1.3; letter-spacing:-.04em;
}
html.shortbook-phone-ui .route-page-head p { margin-top:8px; font-size:13px; line-height:1.55; color:var(--muted); }
html.shortbook-phone-ui .route-kicker { margin-bottom:6px; }
html.shortbook-phone-ui .route-subhead { margin:0 0 14px; }
html.shortbook-phone-ui .route-view .route-subhead strong { color:var(--text); font-size:18px; }
html.shortbook-phone-ui .route-view .route-subhead span { color:var(--muted); font-size:12px; }
html.shortbook-phone-ui .route-chip-row {
  gap:8px; margin:0 0 18px; padding:2px 0 6px; scroll-padding-inline:2px;
  overscroll-behavior-x:contain; scroll-snap-type:x proximity;
}
html.shortbook-phone-ui .route-chip { min-height:44px; padding:0 15px; font-size:13px; scroll-snap-align:start; }

/* A compact shelf with full-size tap targets and two-line titles. */
html.shortbook-phone-ui .route-book-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:22px 12px; }
html.shortbook-phone-ui .route-cover-wrap { max-width:none; border-radius:6px; box-shadow:0 5px 14px rgba(0,0,0,.12); }
html.shortbook-phone-ui .route-cover-button:hover .route-cover-wrap { transform:none; }
html.shortbook-phone-ui .route-cover-button:focus-visible { outline:2px solid var(--mobile-home-gold); outline-offset:4px; }
html.shortbook-phone-ui .route-book-copy { max-width:none; padding-top:9px; gap:4px; }
html.shortbook-phone-ui .route-book-copy strong {
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  min-height:36px; white-space:normal; font-size:13px; line-height:1.4;
  word-break:keep-all; overflow-wrap:anywhere; color:var(--text);
}
/* Category authors follow the actual title, without a reserved second line. */
html.shortbook-phone-ui .route-view[data-route="category"] .route-book-copy strong { min-height:0; }
html.shortbook-phone-ui .route-book-copy span,
html.shortbook-phone-ui .route-book-copy small { font-size:11px; color:var(--muted); }
html.shortbook-phone-ui .route-book-actions { display:grid; grid-template-columns:1fr; gap:4px; margin-top:8px; }
html.shortbook-phone-ui .route-book-actions button { min-height:44px; padding:6px; font-size:12px; border-radius:9px; }
html.shortbook-phone-ui .route-book-badge { left:5px; bottom:5px; max-width:calc(100% - 10px); padding:4px 6px; font-size:10px; }
html.shortbook-phone-ui .route-book-reset { min-height:44px; min-width:44px; }
html.shortbook-phone-ui .library-head-actions { width:100%; justify-content:space-between; gap:12px; }
html.shortbook-phone-ui .library-delete-mode-button { min-height:44px; font-size:12px; }
html.shortbook-phone-ui .library-view-tabs {
  display:grid; grid-template-columns:minmax(0,3fr) minmax(0,1fr);
  width:100%; gap:0; margin:0 0 20px; overflow:visible;
  border-bottom:1px solid var(--line);
}
html.shortbook-phone-ui .library-view-primary-tabs {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr));
  padding:0; gap:0; border:0; border-radius:0; background:transparent;
}
html.shortbook-phone-ui .library-view-tabs button,
html.shortbook-phone-ui .library-view-tabs .library-view-archive-tab {
  justify-content:center; flex-wrap:wrap; gap:4px; min-width:0; min-height:48px;
  margin:0; padding:8px 2px; border:0; border-bottom:2px solid transparent;
  border-radius:0; background:transparent; font-size:12px; color:var(--muted);
}
html.shortbook-phone-ui .library-view-tabs button span { font-size:10px; color:inherit; }
html.shortbook-phone-ui .library-view-tabs button.is-selected {
  background:transparent; border-bottom-color:var(--mobile-home-gold); color:var(--mobile-home-gold); font-weight:800;
}

/* Overview first, optional calendar, then readable recent-book rows. */
html.shortbook-phone-ui .route-view[data-route="records"] .reading-record-dashboard { gap:20px; }
html.shortbook-phone-ui .route-view[data-route="records"] .reading-record-side { order:-1; display:flex; flex-direction:column; gap:10px; }
html.shortbook-phone-ui .reading-record-summary.is-compact { grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; }
html.shortbook-phone-ui .reading-record-summary.is-compact > div { grid-column:span 2; }
html.shortbook-phone-ui .reading-record-summary.is-compact > div:nth-last-child(-n+2) { grid-column:span 3; }
html.shortbook-phone-ui .route-view[data-route="records"] .reading-record-summary.is-compact > div { padding:12px 10px; }
html.shortbook-phone-ui .reading-record-summary.is-compact span { font-size:11px; color:var(--muted); }
html.shortbook-phone-ui .reading-record-summary.is-compact strong { font-size:16px; white-space:normal; overflow-wrap:anywhere; color:var(--text); }
html.shortbook-phone-ui .reading-calendar-disclosure { border:1px solid var(--line); border-radius:12px; }
html.shortbook-phone-ui .reading-calendar-disclosure > summary { min-height:48px; padding:0 14px; }
html.shortbook-phone-ui .reading-calendar-disclosure .reading-calendar-panel { border:0; background:transparent; }
html.shortbook-phone-ui .reading-calendar-panel.is-compact .reading-calendar-nav button { min-width:44px; min-height:44px; }
html.shortbook-phone-ui .reading-calendar-panel.is-compact .reading-calendar-weekdays span,
html.shortbook-phone-ui .reading-calendar-panel.is-compact .reading-calendar-day > span { font-size:11px; }
html.shortbook-phone-ui .route-view[data-route="records"] .reading-record-primary { padding:0; border:0; border-radius:0; background:transparent; }
html.shortbook-phone-ui .route-view[data-route="records"] .reading-record-primary .route-subhead { margin:0 0 12px; padding:0; border:0; }
html.shortbook-phone-ui .reading-record-primary .reading-record-book {
  grid-template-columns:48px minmax(0,1fr) 56px; gap:10px; padding:12px 0;
  border:0; border-bottom:1px solid var(--line); border-radius:0; background:transparent;
}
html.shortbook-phone-ui .reading-record-primary .reading-record-cover { width:48px; height:72px; grid-row:1; }
html.shortbook-phone-ui .reading-record-primary .reading-record-heading strong { font-size:13px; line-height:1.4; }
html.shortbook-phone-ui .reading-record-heading span { font-size:11px; }
html.shortbook-phone-ui .reading-record-heading b { font-size:12px; }
html.shortbook-phone-ui .reading-record-meta { gap:4px; }
html.shortbook-phone-ui .reading-record-meta span { padding:2px 4px; font-size:10px; }
html.shortbook-phone-ui .reading-record-primary .reading-record-read {
  grid-column:3; grid-row:1; justify-self:stretch; min-height:44px;
  padding:0 4px; font-size:11px; border-radius:10px;
}

/* Profile: identity and level, followed by a 2 × 2 stats grid. */
html.shortbook-phone-ui .route-view[data-route="profile"] { padding:0 16px 24px; }
html.shortbook-phone-ui .route-view[data-route="profile"] .profile-showcase-scene {
  min-height:0; margin:0 -16px; padding:26px 18px 22px; box-shadow:none;
}
html.shortbook-phone-ui .route-view[data-route="profile"] .profile-showcase-actions { top:16px; right:16px; }
html.shortbook-phone-ui .route-view[data-route="profile"] .profile-showcase-more { width:44px; height:44px; color:#f0e4cc; background:rgba(0,0,0,.5); }
html.shortbook-phone-ui .route-view[data-route="profile"] .profile-more-menu { max-width:calc(100vw - 36px); }
html.shortbook-phone-ui .profile-more-menu button { min-height:44px; font-size:13px; }
html.shortbook-phone-ui .route-view[data-route="profile"] .profile-showcase-identity {
  position:relative; inset:auto; display:grid; grid-template-columns:64px minmax(0,1fr);
  align-items:center; gap:18px 16px;
}
html.shortbook-phone-ui .profile-showcase-avatar { width:64px; height:64px; font-size:25px; }
html.shortbook-phone-ui .profile-showcase-copy { padding:0 40px 0 0; }
html.shortbook-phone-ui .profile-showcase-copy h2 { font-size:25px; line-height:1.25; overflow-wrap:anywhere; }
html.shortbook-phone-ui .profile-showcase-badges { gap:5px; margin-top:9px; }
html.shortbook-phone-ui .profile-showcase-badges > span { height:auto; min-height:26px; padding:4px 8px; font-size:11px; white-space:normal; }
html.shortbook-phone-ui .profile-showcase-reading-meta { gap:4px 8px; margin-top:10px; }
html.shortbook-phone-ui .profile-showcase-reading-meta > span { font-size:11px; color:#d0ccc5; }
html.shortbook-phone-ui .profile-showcase-level { grid-column:1/-1; width:100%; padding:0; }
html.shortbook-phone-ui .profile-showcase-level strong { font-size:22px; }
html.shortbook-phone-ui .profile-showcase-level span { font-size:11px; }
html.shortbook-phone-ui .profile-showcase-progress { height:8px; margin-top:8px; }
html.shortbook-phone-ui .route-view[data-route="profile"] .profile-showcase-stats {
  position:relative; inset:auto; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:20px;
}
html.shortbook-phone-ui .profile-showcase-stat { grid-template-columns:32px minmax(0,1fr); gap:9px; min-height:80px; padding:12px 10px; background:rgba(7,8,8,.74); }
html.shortbook-phone-ui .profile-showcase-stat-icon { width:32px; height:32px; }
html.shortbook-phone-ui .profile-showcase-stat-icon svg { width:18px; height:18px; }
html.shortbook-phone-ui .profile-showcase-stat small { font-size:11px; color:#c6c1b8; }
html.shortbook-phone-ui .profile-showcase-stat strong { font-size:18px; white-space:normal; overflow-wrap:anywhere; }
html.shortbook-phone-ui .profile-showcase-scene::before { background:linear-gradient(90deg,rgba(5,6,6,.83),rgba(5,6,6,.4)),linear-gradient(0deg,rgba(5,6,6,.8),transparent); }
html.shortbook-phone-ui .profile-showcase-collections { grid-template-columns:1fr; }
html.shortbook-phone-ui .profile-showcase-collection-panel { min-height:0; padding:18px 0; }
html.shortbook-phone-ui .profile-showcase-collection-head > strong { font-size:17px; }
html.shortbook-phone-ui .profile-showcase-collection-head button { min-height:44px; font-size:12px; }
html.shortbook-phone-ui .profile-showcase-title-list,
html.shortbook-phone-ui .profile-showcase-theme-list { margin-top:10px; }
html.shortbook-phone-ui .profile-showcase-title-chip,
html.shortbook-phone-ui .profile-showcase-title-more,
html.shortbook-phone-ui .profile-showcase-theme-chip { font-size:12px; }
@media (max-width:359px) {
  html.shortbook-phone-ui .route-book-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  html.shortbook-phone-ui .profile-showcase-stat { grid-template-columns:1fr; }
}

/* 18319 — Selected genres, touch cover actions, compact library controls. */
html:not(.shortbook-phone-ui):not(.shortbook-ipad-ui) .genre-section .genre-rail { grid-template-columns:repeat(5,minmax(0,1fr)); }
html.shortbook-ipad-ui .genre-section .genre-rail { grid-template-columns:repeat(3,minmax(0,1fr)); }
@media (orientation:landscape) {
  html.shortbook-ipad-ui .genre-section .genre-rail { grid-template-columns:repeat(5,minmax(0,1fr)); grid-auto-flow:row; gap:12px; }
  html.shortbook-ipad-ui .genre-section .genre-card { min-width:0; }
}
html.shortbook-phone-ui .route-book-actions,
html.shortbook-ipad-ui .route-book-actions { display:none; }
html.shortbook-phone-ui .route-view[data-route="library"] .route-page-head,
html.shortbook-ipad-ui .route-view[data-route="library"] .route-page-head { position:relative; }
.library-delete-mode-button svg { width:16px; height:16px; flex:none; }
.library-delete-mode-button { position:relative; width:32px; height:32px; min-height:32px; padding:0; border-radius:50%; display:grid; place-items:center; }
html.shortbook-phone-ui .library-delete-mode-button,
html.shortbook-ipad-ui .library-delete-mode-button { position:absolute; top:-4px; right:0; width:32px; height:32px; min-height:32px; padding:0; border-radius:50%; }
.library-delete-mode-button::before { content:""; position:absolute; inset:-6px; }
html.shortbook-phone-ui .route-view[data-route="library"] .route-page-head h1,
html.shortbook-ipad-ui .route-view[data-route="library"] .route-page-head h1 { padding-right:44px; }
html.shortbook-phone-ui .route-view[data-route="records"] .reading-record-side { align-items:stretch; width:100%; }
html.shortbook-phone-ui .reading-record-summary.is-compact { width:100%; grid-template-columns:repeat(5,minmax(0,1fr)); gap:5px; }
html.shortbook-phone-ui .reading-record-summary.is-compact > div,
html.shortbook-phone-ui .reading-record-summary.is-compact > div:nth-last-child(-n+2) { grid-column:auto; }
html.shortbook-phone-ui .route-view[data-route="records"] .reading-record-summary.is-compact > div { padding:12px 5px; border-radius:10px; text-align:center; }
html.shortbook-phone-ui .reading-record-summary.is-compact span { font-size:10px; white-space:nowrap; }
html.shortbook-phone-ui .reading-record-summary.is-compact strong { font-size:14px; }
html.shortbook-phone-ui .reading-calendar-disclosure { width:100%; }
html.shortbook-phone-ui .reading-record-list { width:100%; display:flex; flex-direction:column; }
html.shortbook-phone-ui .book-context-menu,
html.shortbook-ipad-ui .book-context-menu { width:min(240px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); overflow-y:auto; }
html.shortbook-phone-ui .book-context-menu button,
html.shortbook-ipad-ui .book-context-menu button { min-height:44px; font-size:14px; }
@media (any-pointer:coarse) {
  .book-cover-shell, .route-cover-button, .reading-record-cover,
  [data-rank-hero3d], [data-hero-book-webgl], .continue-reading-cover {
    -webkit-touch-callout:none; -webkit-user-select:none; user-select:none;
  }
  .book-cover-shell img, .route-cover-button img, .reading-record-cover img,
  [data-rank-hero3d] img, [data-hero-book-webgl] img { -webkit-touch-callout:none; -webkit-user-drag:none; }
}

/* 18321: native vertical scroll + horizontal hero gestures on phones. */
html.shortbook-phone-ui .hero-section { touch-action:pan-y pinch-zoom; }
html.shortbook-phone-ui .hero-section [data-hero-cover] { -webkit-user-drag:none; user-select:none; }
/* The shell owns the transform so the existing liked heart follows the cover. */
html.shortbook-ipad-ui .recommendation-section .book-card.is-touch-preview { position:relative; z-index:3; }
html.shortbook-ipad-ui .recommendation-section .book-card.is-touch-preview > .book-cover-shell {
  transform:translateY(-6px) scale(1.055); transform-origin:center bottom;
  transition:transform .34s cubic-bezier(.22,.72,.22,1);
}
@media (any-hover:hover) {
  html.shortbook-ipad-ui .recommendation-section .book-card:hover > .book-cover-shell {
    transform:translateY(-6px) scale(1.055);
  }
}
@media (prefers-reduced-motion:reduce) {
  html.shortbook-ipad-ui .recommendation-section .book-card.is-touch-preview > .book-cover-shell,
  html.shortbook-ipad-ui .recommendation-section .book-card:hover > .book-cover-shell { transform:none; transition:none; }
}
html.shortbook-ipad-ui .recommendation-section .book-rail {
  padding-top:24px; margin-top:-24px;
  padding-left:6px; padding-right:6px; margin-left:-6px; margin-right:-6px;
}
