/* BYoB v54-v55 refresh layer. Loads after brutalist.css and overrides it.
   Rules: zero emoji, Times stays the reading and title face, text never cut off with dots. */

/* --------------------------------------------------------------------------
   Library tiles: whole cover, 2:3 book shape, never cropped
   -------------------------------------------------------------------------- */
.novel-grid {
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 22px 18px;
}

.novel-card {
  border: none;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.novel-card:hover {
  transform: none;
  box-shadow: none;
}

.novel-card-cover-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 24px -8px rgba(0, 0, 0, 0.6);
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.18s ease;
}

.novel-card-cover-wrap::after {
  /* thin inner edge so light covers do not melt into light themes */
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  background: none;
  pointer-events: none;
}

@media (hover: hover) {
  .novel-card-cover-wrap:hover {
    transform: translateY(-3px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 34px -10px rgba(0, 0, 0, 0.7);
  }
}

.novel-card-cover-wrap:active {
  transform: scale(0.98);
}

/* Blurred copy fills the box; the sharp cover sits on top, whole */
.novel-card-cover-bg {
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  object-fit: cover;
  filter: blur(18px) saturate(1.2) brightness(0.7);
  pointer-events: none;
}

.novel-card-cover {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: none;
}

.novel-card:hover .novel-card-cover {
  transform: none;
}

.novel-card-cover-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2;
}

.novel-card-cover-progress > div {
  height: 100%;
  background: var(--accent);
}

.novel-card-body {
  padding: 10px 2px 0;
}

.novel-card-title {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.novel-card-author {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  margin-bottom: 8px;
}

.novel-card-progress-info span:first-child,
.novel-list-progress-info {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  max-width: none !important;
}

.novel-card-progress-info {
  gap: 8px;
  line-height: 1.35;
}

.novel-card-progress-info span:last-child {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* List view: same rule, whole cover */
.novel-list-cover-wrap {
  width: 56px;
  height: 84px;
  border-radius: 5px;
  border: none;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.6);
}

.novel-list-cover {
  object-fit: cover;
}

.novel-list-title {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* --------------------------------------------------------------------------
   Continue Reading hero: whole cover, blurred cover glow behind
   -------------------------------------------------------------------------- */
.resume-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.resume-backdrop {
  position: absolute;
  inset: -40px;
  z-index: -1;
  background-size: cover;
  background-position: center;
  filter: blur(40px) saturate(1.3);
  opacity: 0.28;
  pointer-events: none;
}

.resume-cover {
  object-fit: contain;
  background: var(--bg-card);
  border: none;
  box-shadow: 0 10px 26px -8px rgba(0, 0, 0, 0.7);
}

/* --------------------------------------------------------------------------
   Upload form: optional cover picture
   -------------------------------------------------------------------------- */
.upload-cover-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.upload-cover-thumb {
  width: 64px;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
}

.upload-cover-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.upload-cover-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  padding: 4px;
}

.upload-cover-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.upload-cover-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

@media (max-width: 768px) {
  .novel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px 12px !important;
  }

  .novel-card-cover-wrap {
    aspect-ratio: 2 / 3;
  }

  .novel-card-body {
    padding: 8px 1px 0;
  }

  .novel-card-title {
    font-size: 14px;
  }
}

/* --------------------------------------------------------------------------
   Speed: menus open in the first frame
   - every blur sat on a solid background (cost with no look): removed
   - side panel slides with transform (GPU) instead of animating `right` (layout every frame)
   - backdrops fade with opacity + visibility instead of jumping from display:none
   - 3,000+ chapter rows skip layout and paint while off screen
   -------------------------------------------------------------------------- */
.app-header,
.reader-top-bar,
.reader-floating-bar,
.autoscroll-pill,
.tts-mini-badge,
.cover-overlay-badge,
.drawer-backdrop,
.quick-sheet-backdrop,
.modal-overlay {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.drawer.master-panel {
  right: 0;
  transform: translate3d(calc(100% + 32px), 0, 0);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
  contain: layout paint;
}

.drawer.master-panel.open {
  transform: none;
}

.drawer-backdrop,
.quick-sheet-backdrop {
  display: block;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}

.drawer-backdrop.open,
.quick-sheet-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.18s ease, visibility 0s;
}

.mobile-quick-sheet {
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.toc-item {
  content-visibility: auto;
  contain-intrinsic-size: auto 40px;
  transition: none;
}

.toc-item[hidden],
.toc-filtered .toc-volume-header {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .drawer.master-panel,
  .drawer.master-panel.open,
  .mobile-quick-sheet,
  .drawer-backdrop,
  .quick-sheet-backdrop {
    transition: none;
  }
}

/* ==========================================================================
   v54 look: quiet, bookish, premium. Theme colors still come from the
   theme variables, so every theme (dark, light, sepia, paper...) keeps working.
   ========================================================================== */
:root {
  --r-ctl: 12px;
  --r-card: 16px;
  --hairline: color-mix(in srgb, var(--text-primary) 10%, transparent);
  --soft-fill: color-mix(in srgb, var(--text-primary) 6%, transparent);
  --press: scale(0.97);
}

/* Buttons: rounder, calmer, a real press */
.btn-brutal {
  border-radius: var(--r-ctl);
  border-color: var(--hairline);
  background: var(--soft-fill);
  font-weight: 600;
  letter-spacing: 0.1px;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-brutal:active,
.choice-btn:active,
.segmented-btn:active {
  transform: var(--press);
}

.btn-brutal-accent {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 6px 16px -8px rgba(0, 0, 0, 0.6);
}

.badge-brutal {
  border-radius: 999px;
  border-color: var(--hairline);
  font-variant-numeric: tabular-nums;
}

.form-input,
.drawer-search-input,
.library-search-input,
.library-sort-select {
  border-radius: var(--r-ctl);
}

/* Header: serif wordmark, light hairline, no heavy border */
.app-header {
  border-bottom: 1px solid var(--hairline);
  padding-top: calc(10px + var(--safe-top));
  padding-bottom: 10px;
}

.logo-icon {
  border-radius: 10px;
  font-family: var(--font-times);
  font-weight: 700;
  font-size: 22px;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.6);
}

.logo-title {
  font-family: var(--font-times);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.logo-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
}

.header-controls .btn-brutal {
  border-radius: 999px;
  padding: 9px 16px;
}

/* Library heading and toolbar */
.section-title {
  font-family: var(--font-times);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0;
}

#libraryCountBadge {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 500;
  padding-left: 2px;
}

.library-toolbar {
  border-bottom: none;
  padding-bottom: 6px;
  margin-bottom: 18px;
}

.library-search-box,
.library-sort-select,
.segmented-control {
  min-height: 42px;
  border-radius: var(--r-ctl);
  border-color: var(--hairline);
  background-color: var(--soft-fill);
}

.library-search-input {
  border: none;
  background: transparent;
  min-width: 0;
  width: 100%;
  text-overflow: clip;
}

.segmented-btn {
  border-radius: 9px;
}

.segmented-btn.active {
  background: var(--bg-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* Cards: quieter meta, slim progress, compact actions */
.novel-card-title,
.novel-list-title {
  font-family: var(--font-times);
  font-weight: 700;
  letter-spacing: 0.1px;
}

.novel-card-author,
.novel-list-author {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.novel-card-meta .badge-brutal,
.novel-list-meta .badge-brutal {
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  padding: 1px 8px;
}

.progress-bar-container {
  height: 3px;
  border-radius: 999px;
  border: none;
  background: var(--hairline);
  overflow: hidden;
}

.progress-bar-fill {
  border-radius: 999px;
}

.novel-card-actions .btn-brutal {
  min-height: 40px;
  border-radius: 999px;
}

.novel-card-actions .novel-settings-cog-btn {
  width: 40px;
  padding: 0 !important;
  background: transparent;
}

.novel-card-list {
  border-radius: var(--r-card);
  border-color: var(--hairline);
}

/* Continue Reading hero */
.resume-hero {
  border-radius: 20px;
  border: 1px solid var(--hairline);
  background: var(--bg-surface);
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
}

.resume-info h3 {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--text-muted);
}

.resume-info h2 {
  font-family: var(--font-times);
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.resume-cover {
  border-radius: 8px;
}

#resumeReadBtn {
  border-radius: 999px;
  padding: 11px 22px;
}

/* Version: sits quietly at the end of the library, never floats over covers */
.app-version-tag {
  position: static;
  display: block;
  text-align: center;
  padding: 28px 0 calc(18px + var(--safe-bottom));
  opacity: 0.55;
}

/* Side menu */
.drawer.master-panel {
  border-left: 1px solid var(--hairline);
}

.master-panel-title {
  font-family: var(--font-times);
  font-size: 19px;
  line-height: 1.2;
}

.master-nav-tabs {
  width: auto;
  box-sizing: border-box;
  margin: 8px 14px 0;
  padding: 4px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--soft-fill);
}

.master-tab-btn {
  border-radius: 10px;
  font-weight: 600;
}

.master-tab-btn.active {
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.5);
}

.master-panel-body {
  padding: 18px 16px calc(24px + var(--safe-bottom));
}

.form-label {
  letter-spacing: 0.4px;
}

.choice-btn {
  border-radius: var(--r-ctl);
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.toc-item {
  border-radius: 10px;
}

.toc-item.active {
  border-left-width: 3px;
}

.toc-chapter-title {
  overflow-wrap: anywhere;
}

/* Quick sheet */
.mobile-quick-sheet {
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border-color: var(--hairline);
}

.mobile-quick-sheet .quick-sheet-handle {
  width: 40px;
  height: 5px;
  border-radius: 3px;
}

/* Modals */
.modal-content {
  border-radius: 20px;
  border-color: var(--hairline);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
}

.modal-title {
  font-family: var(--font-times);
}

/* iPhone: two clean toolbar rows, nothing squeezed */
@media (max-width: 768px) {
  .library-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .library-toolbar-right {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    width: 100%;
  }

  .library-search-box {
    grid-column: 1 / -1;
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
  }

  .library-sort-control {
    min-width: 0;
  }

  .library-sort-select {
    width: 100%;
  }

  .header-controls .btn-brutal {
    padding: 8px 14px;
  }

  .master-nav-tabs {
    margin: 8px 10px 0;
  }
}

.library-sort-select {
  padding-right: 30px;
  background-position: right 12px center;
}

/* --------------------------------------------------------------------------
   Audit: no text cut off with dots anywhere, no cover cropped anywhere
   -------------------------------------------------------------------------- */
.novel-list-author,
.reader-ch-info,
.audiobook-header-title,
.audiobook-header-chapter,
.upload-file-details,
.upload-file-name,
.quick-sheet-chapter-title,
.quick-tile-label,
.resume-info h2,
#resumeNovelTitle,
.resume-chapter-tag {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  -webkit-line-clamp: unset !important;
  display: block;
  overflow-wrap: anywhere;
}

.quick-tile-label {
  display: inline-block;
  text-align: center;
  line-height: 1.2;
}

.reader-ch-info {
  line-height: 1.3;
  font-size: 12.5px;
}

.novel-list-cover,
.tts-mini-cover-img,
.audiobook-modal-cover,
.resume-cover {
  object-fit: contain !important;
  background: var(--bg-card);
}

/* Long URLs in the menu: show the whole address, wrapped, instead of a clipped box */
.url-wrap-field {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
  min-width: 0;
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-ctl);
  background: var(--soft-fill);
  color: var(--text-primary);
}

.logo-sub {
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   v55: safe areas (iPhone Dynamic Island, home indicator, landscape sides)
   All insets go through --safe-* (brutalist.css :root), never env() directly.
   -------------------------------------------------------------------------- */
body {
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

/* The body already pads by --safe-top; the sticky header pads for the status bar itself, so pull it up
   over the body padding instead of counting the inset twice (it sits right under the status bar). */
.app-header {
  margin-top: calc(-1 * var(--safe-top));
  padding-left: max(20px, calc(12px + var(--safe-left)));
  padding-right: max(20px, calc(12px + var(--safe-right)));
}

.reader-top-bar {
  padding-left: max(18px, calc(10px + var(--safe-left)));
  padding-right: max(18px, calc(10px + var(--safe-right)));
}

.drawer.master-panel {
  padding-right: var(--safe-right);
}

.floating-quick-menu-btn {
  right: calc(20px + var(--safe-right));
}

.toast-container {
  right: calc(18px + var(--safe-right));
}

.app-version-tag {
  left: calc(12px + var(--safe-left));
}

.modal-overlay {
  padding-top: calc(16px + var(--safe-top));
  padding-bottom: calc(16px + var(--safe-bottom));
}

/* id + class: beats the inline critical styles in index.html <head>, which load after this file */
#mobileQuickSheet.mobile-quick-sheet {
  max-height: min(88vh, calc(100vh - var(--safe-top) - 12px));
  padding-left: calc(16px + var(--safe-left));
  padding-right: calc(16px + var(--safe-right));
}

@media (max-width: 768px) {
  .tts-mini-badge {
    right: calc(14px + var(--safe-right));
  }
}

/* --------------------------------------------------------------------------
   v55: quick sheet pickers (theme swatches, font chips), engine switch
   -------------------------------------------------------------------------- */
.quick-sheet-chapter-meta {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.quick-sheet-chapter-meta:empty {
  display: none;
}

.quick-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px 0 6px;
  width: 100%;
  box-sizing: border-box;
}

.quick-picker-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 10px;
}

.quick-picker-title,
.engine-switch-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quick-picker-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.theme-swatch-row,
.font-chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 10px 4px;
  scroll-padding: 0 10px;
}

.theme-swatch-row::-webkit-scrollbar,
.font-chip-row::-webkit-scrollbar {
  display: none;
}

.theme-swatch {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  width: 60px;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: var(--font-sans);
}

.theme-swatch-tile {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--sw-bg);
  color: var(--sw-fg);
  border: 1px solid color-mix(in srgb, var(--sw-fg) 18%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 0 transparent;
  transition: box-shadow 0.15s ease, transform 0.12s ease;
}

.theme-swatch-aa {
  font-family: var(--font-times);
  font-size: 19px;
  font-weight: 600;
  line-height: 1;
}

.theme-swatch-dot {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sw-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--sw-bg) 60%, transparent);
}

.theme-swatch-name {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.theme-swatch:active .theme-swatch-tile {
  transform: scale(0.95);
}

.theme-swatch.selected .theme-swatch-tile {
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--text-primary);
}

.theme-swatch.selected .theme-swatch-name {
  color: var(--text-primary);
  font-weight: 700;
}

.theme-swatch:focus-visible .theme-swatch-tile {
  outline: 2px solid var(--text-primary);
  outline-offset: 3px;
}

/* Display tab: same swatches as a wrapping grid */
.theme-swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 12px 6px;
  justify-items: center;
}

.theme-swatch-grid .theme-swatch {
  width: 64px;
}

/* Every font option is drawn in its own face: a [data-font] element gets its own --reader-font */
.font-chip {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--reader-font) !important;
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.font-chip:active {
  transform: scale(0.96);
}

.font-chip.selected {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.choice-btn.font-btn[data-font] {
  font-family: var(--reader-font);
  font-size: 14px;
}

/* Voice engine segmented control */
.engine-switch {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.quick-sheet-engine {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px 10px;
}

.engine-switch-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.engine-switch-status {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
}

.engine-switch-status.engine-live {
  color: var(--text-primary);
}

.engine-switch-detail,
.engine-note {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.engine-note {
  margin-top: 4px;
}

/* The voice report: which build this app is and what the server last said about the PC. It is the
   only way to tell a stale app from a real fault on a home-screen phone, which has no address bar,
   no console and no reload button (2026-11-25: three nights were spent guessing at that). Small and
   grey, so it reads as a footnote rather than an error. */
.engine-switch-report {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--text-muted);
  opacity: 0.85;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.engine-seg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 3px;
  border-radius: 11px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
}

.engine-seg-btn {
  appearance: none;
  -webkit-appearance: none;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.engine-seg-btn.active {
  background: var(--accent);
  color: var(--accent-text);
}

.studio-locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.studio-lock-note {
  margin: 4px 0 0;
}

.engine-seg-compact .engine-seg-btn {
  height: 26px;
  font-size: 11px;
}

.quick-sheet-footer-single {
  grid-template-columns: 1fr;
}

/* Reading stats card (Display tab) */
.stats-card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-surface);
  padding: 12px 14px;
  margin-bottom: 18px;
}

.stats-card-title {
  font-family: var(--font-times);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.stats-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stats-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stats-label,
.stats-sub {
  font-size: 10.5px;
  color: var(--text-muted);
}

.stats-sub {
  margin-top: 8px;
  line-height: 1.4;
}
