/* Recovered Export Studio layout based on the original October 30 TEJMAR Export page.
   This stylesheet is scoped to the React Export Studio route. The shared original
   React header, Settings dropdown and global footer remain supplied by PageFrame. */
.tms-export-page > .tr-page-heading { display:none; }
.tms-export-page { padding-top:clamp(24px,3.5vw,42px); }
.tms-export-recovery { max-width:1380px; margin:0 auto; min-width:0; }
.tms-export-recovery .tms-workspace-hero { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; flex-wrap:wrap; margin:0 0 24px; }
.tms-export-recovery .tms-kicker { margin:0 0 10px; color:hsl(var(--primary)); font-size:10px; font-weight:800; letter-spacing:.16em; text-transform:uppercase; }
.tms-export-recovery .tms-title { margin:0 0 12px; color:hsl(var(--foreground)); font:600 clamp(30px,4.5vw,48px)/1.04 'DM Serif Display',Georgia,serif; letter-spacing:-.025em; }
.tms-export-recovery .tms-lead { max-width:780px; margin:0; color:hsl(var(--muted-foreground)); font-size:14px; line-height:1.7; }
.tms-export-recovery .tms-preview-stage { display:inline-block; padding:5px 9px; border:1px solid hsl(var(--border)); border-radius:999px; color:hsl(var(--muted-foreground)); font-size:10px; font-weight:750; letter-spacing:.08em; text-transform:uppercase; }
.tms-export-layout { display:grid; grid-template-columns:minmax(300px,.78fr) minmax(0,1.22fr); align-items:start; gap:22px; }
.tms-export-layout > .tr-panel { min-width:0; padding:20px; border:1px solid hsl(var(--border)); border-radius:14px; background:hsl(var(--card)); box-shadow:none; }
.tms-export-layout > .tr-panel .tr-panel-head { margin-bottom:18px; }
.tms-export-layout > .tr-panel .tr-panel-head h2 { margin:0 0 6px; color:hsl(var(--foreground)); font:600 21px/1.2 'DM Serif Display',Georgia,serif; letter-spacing:0; }
.tms-export-layout > .tr-panel .tr-panel-head p { margin:7px 0 0; color:hsl(var(--muted-foreground)); font-size:12px; line-height:1.65; }
.tms-export-layout .tr-form { gap:13px; }
.tms-export-layout .tr-export-section-title { margin-top:7px; padding-top:14px; border-top:1px solid hsl(var(--border)); color:hsl(var(--muted-foreground)); font-size:10px; font-weight:800; letter-spacing:.13em; text-transform:uppercase; }
.tms-export-layout .tr-export-preview-viewport { display:flex; justify-content:center; align-items:flex-start; padding:18px; border:1px solid hsl(var(--border)); border-radius:9px; background:hsl(var(--secondary)/.34); max-height:72vh; overflow:auto; }
.tms-export-layout .tr-paper { min-height:420px; margin:0 auto; border:1px solid #d7d7d7; border-radius:2px; background:#fff; color:#242424; box-shadow:0 8px 30px #00000012; }
.tms-export-layout .tr-paper-title-page { min-height:210px; }
.tms-export-layout .tr-paper-body { color:#252525; }
.tms-export-layout .tr-hint { font-size:11px; line-height:1.65; }
.tms-export-layout .tr-download-link { text-decoration:none; }
.tms-export-layout .tr-export-live-preview { min-width:0; }
@media(max-width:900px) {
  .tms-export-layout { grid-template-columns:minmax(0,1fr); }
  .tms-export-layout .tr-export-preview-viewport { max-height:68vh; }
}
@media(max-width:640px) {
  .tms-export-page { padding-top:22px; }
  .tms-export-layout > .tr-panel { padding:15px; border-radius:10px; }
  .tms-export-recovery .tms-workspace-hero { gap:12px; margin-bottom:17px; }
  .tms-export-recovery .tms-title { font-size:clamp(29px,9vw,38px); }
  .tms-export-recovery .tms-lead { font-size:13px; }
  .tms-export-layout .tr-export-preview-viewport { max-height:66vh; padding:10px; }
  .tms-export-layout .tr-paper { min-height:320px; }
}

/* Audiobook text-following: highlight the paragraph covering the current audio segment. */
.tr-book-page-text .tr-reader-paragraph,
.tr-public-chapter-copy .tr-public-chapter-paragraph { margin:0 0 .95em; padding:.12em .45em; border-left:3px solid transparent; border-radius:2px; transition:background-color .18s ease,border-color .18s ease; scroll-margin-block:35vh; }
.tr-book-page-text .tr-reader-paragraph-speaking,
.tr-public-chapter-copy .tr-reader-paragraph-speaking { border-left-color:#df1526; background:#df152612; box-shadow:0 0 0 3px #df152610; }

/* Mobile reader: use the available page width instead of a narrow 75vw paper strip. */
@media(max-width:700px) {
  .tr-reader-workspace { height:75dvh; min-height:360px; max-height:calc(100dvh - 132px); }
  .tr-reader-contents { max-height:112px; padding:8px 10px; }
  .tr-reader-contents-list { display:flex; gap:6px; overflow-x:auto; overflow-y:hidden; padding:2px 0 5px; scroll-snap-type:x proximity; }
  .tr-reader-chapter { flex:0 0 min(220px,62vw); min-width:0; grid-template-columns:25px minmax(0,1fr); scroll-snap-align:start; }
  .tr-reader-stage { padding:8px 4px; overflow-x:hidden; align-items:stretch; }
  .tr-book-page-stack { width:calc(100% - 8px); max-width:620px; min-height:66dvh; padding:clamp(22px,5vw,38px) clamp(18px,5vw,36px); margin:0 auto; box-sizing:border-box; }
  .tr-book-page-stack .tr-book-page-text { font-size:clamp(15px,4.2vw,17px); line-height:1.85; text-align:left; }
}
@media(max-width:480px) {
  .tr-reader-workspace { height:75dvh; min-height:350px; max-height:calc(100dvh - 124px); }
  .tr-reader-contents { max-height:104px; }
  .tr-reader-chapter { flex-basis:min(205px,66vw); font-size:10px; }
  .tr-book-page-stack { width:calc(100% - 6px); min-height:64dvh; padding:22px 17px; }
  .tr-book-page-stack .tr-book-page-text { font-size:15px; line-height:1.82; }
}

.tms-export-estimate { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 13px; border:1px solid hsl(var(--border)); border-radius:8px; background:hsl(var(--secondary)/.34); }
.tms-export-estimate span { color:hsl(var(--muted-foreground)); font-size:11px; font-weight:650; }
.tms-export-estimate strong { color:hsl(var(--foreground)); font-size:13px; font-weight:750; font-variant-numeric:tabular-nums; }
.tms-export-includes { margin-top:20px; padding-top:16px; border-top:1px solid hsl(var(--border)); }
.tms-export-includes h3 { margin:0 0 9px; color:hsl(var(--foreground)); font-size:12px; font-weight:750; }
.tms-export-includes ul { margin:0; padding-left:19px; list-style:disc; color:hsl(var(--muted-foreground)); font-size:11px; line-height:1.75; }
.tms-export-includes .tr-hint { margin-top:12px; }
