:root{font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#25312e;background:#f5f5f1}*{box-sizing:border-box}body{margin:0}header{height:62px;background:#233c38;color:white;display:flex;align-items:center;justify-content:space-between;padding:0 22px;position:sticky;top:0;z-index:5}.brand{font-size:19px;font-weight:750}#connect{font-size:12px;color:#cce5dc}.layout{display:grid;grid-template-columns:270px minmax(0,1fr);max-width:1320px;margin:auto;min-height:calc(100vh - 62px)}aside{padding:24px 17px;border-right:1px solid #e1e5df;background:#edf1ec}aside h3{margin:5px 0 15px;font-size:15px}label{display:block;font-size:13px;font-weight:650;margin:12px 0 6px}select,input,textarea{font:inherit;width:100%;padding:11px;border:1px solid #cdd5ce;border-radius:9px;background:white;color:#24312e}textarea{resize:vertical;line-height:1.65}button,.upload{border:0;border-radius:9px;background:#285d4f;color:white;padding:10px 13px;cursor:pointer;font:inherit;font-weight:650;font-size:13px}button:hover,.upload:hover{filter:brightness(.93)}button:disabled{opacity:.4;cursor:default}aside button,.upload{display:block;width:100%;text-align:center;margin:9px 0}.subtle{background:#dce5dd;color:#2d4941}.hint{font-size:12px;color:#64736b;line-height:1.5}.nav{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:16px}.nav button{background:#e1e9e3;color:#2a4c40}.nav #position{font-size:13px;text-align:center;color:#59685f}main{padding:22px 35px 45px;max-width:930px;width:100%;margin:auto}section{background:white;border:1px solid #e2e7e0;border-radius:13px;padding:21px 24px;margin:13px 0;box-shadow:0 2px 8px #253b3108}.source{border-left:4px solid #476e61}.sectiontitle{font-size:11px;letter-spacing:.09em;font-weight:800;color:#62746b;display:flex;align-items:center;justify-content:space-between;margin-bottom:13px}.reading{font-family:Georgia,serif;font-size:19px;line-height:1.75;white-space:pre-wrap;overflow-wrap:anywhere}.translation{font-size:17px}.empty{font:italic 14px ui-sans-serif,sans-serif;color:#9aa59e}.mini{font-size:11px;padding:6px 9px;background:#e2ede6;color:#2a5b48;letter-spacing:0}.editor{background:#fdfefd}.editor textarea{margin:0 0 17px}.controls{display:flex;gap:12px;align-items:end;justify-content:space-between}.controls label{flex:1}.controls button{margin-bottom:6px}.tag{display:inline-flex;gap:5px;align-items:center;background:#e4eee8;color:#285849;padding:7px 10px;border-radius:18px;margin:3px;font-size:12px;cursor:pointer}.tag.selected{background:#2a6755;color:white}.tagnew{display:flex;gap:8px;margin-top:12px}.tagnew input{flex:1}.tagnew button{white-space:nowrap}.bottom{margin-top:20px}#counts{color:#607368;font-size:13px;margin:15px 0}hr{border:0;border-top:1px solid #d2ddd4;margin:24px 0}@media(max-width:760px){.layout{display:flex;flex-direction:column}aside{border:0;border-bottom:1px solid #d4ded5;padding:12px 18px}aside h3{display:none}main{padding:14px}section{padding:17px 16px}.reading{font-size:18px}.brand{font-size:16px}header{height:52px}.nav button{font-size:12px;padding:10px}aside{display:grid;grid-template-columns:1fr 1fr;gap:4px 10px}aside #book,aside #counts,aside hr,aside .hint{grid-column:span 2}aside .upload,aside button{margin:3px 0}aside label{margin:2px 0}.controls{flex-wrap:wrap}}@media(min-width:761px){aside{position:sticky;top:62px;height:calc(100vh - 62px);overflow:auto}}

/* Pilot: English stays visible while the rest of the paragraph scrolls. */
.source{position:sticky;top:62px;z-index:4;max-height:38vh;overflow-y:auto;box-shadow:0 4px 16px #253b3120;background:#fff}
@media(max-width:760px){.source{top:52px;max-height:35vh}}

/* V2.6 compact review: screen-height layout, independent scroll areas */
#reviewToggle{background:#dcece3;color:#173e32;margin-left:10px;font-size:12px;padding:7px}
.reviewbar{display:none}
body.review-mode{overflow:hidden}
.review-mode header{height:44px;padding:0 10px;position:relative;z-index:8}
.review-mode .brand{font-size:14px}
.review-mode #connect{display:none}
.review-mode .layout{display:block;height:calc(var(--review-vh,100dvh) - 44px);min-height:0;max-width:none}
.review-mode aside{display:none}
.review-mode main{height:100%;max-width:none;display:flex;flex-direction:column;padding:6px 10px 0;overflow:hidden}
.review-mode main>.nav,.review-mode main>.bottom{display:none}
.review-mode #page{display:flex!important;flex-direction:column;gap:6px;flex:1;min-height:0;overflow:hidden}
.review-mode section{margin:0;padding:7px 10px;border-radius:8px;box-shadow:none;min-height:0}
.review-mode .source{position:static;flex:1;overflow:auto;max-height:none}
.review-mode #page>section:has(#ai){flex:1;overflow:auto}
.review-mode .reading{font-size:15px;line-height:1.35}
.review-mode .sectiontitle{font-size:10px;margin-bottom:3px;letter-spacing:.02em}
.review-mode .editor{flex:1.35;display:flex;flex-direction:column;overflow:hidden}
.review-mode #final{flex:1;min-height:48px;resize:none;margin:0;font-size:16px;line-height:1.35;padding:7px}
.review-mode .editor .sectiontitle:has(+ #notes),.review-mode #notes,.review-mode .editor .sectiontitle:has(+ #authorResponse),.review-mode #authorResponse,.review-mode .controls,.review-mode .editor .sectiontitle:has(+ #tags),.review-mode #tags,.review-mode .tagnew{display:none}
.review-mode.notes-open .editor .sectiontitle:has(+ #notes),.review-mode.notes-open #notes{display:block}
.review-mode.notes-open #notes{height:62px;min-height:42px;flex:0 0 auto;margin:0 0 4px;font-size:16px;line-height:1.25}
.review-mode .reviewbar{display:flex;align-items:center;gap:6px;flex:0 0 auto;padding:5px 0 max(5px,env(safe-area-inset-bottom));background:#f5f5f1}
.review-mode .reviewbar button{font-size:13px;padding:10px 8px}
.review-mode #reviewApprove{flex:1;background:#196747;font-size:15px;min-height:44px}
.review-mode #reviewPosition{font-size:11px;color:#50665a;white-space:nowrap}
.review-mode #reviewPrev,.review-mode #reviewNotes{background:#e1e9e3;color:#244d3c}
@media(max-width:760px){.review-mode .brand small{display:none}.review-mode #freshSession{display:none}.review-mode .source{max-height:none}.review-mode .layout{display:block}}

/* V2.7 mobile-first streamlined review */
.review-top,.review-reference{display:none}
.review-mode .review-top{display:flex;align-items:center;justify-content:space-between;gap:7px;flex:0 0 auto;padding:4px 1px;font-size:12px;color:#435a4d}
.review-mode #reviewBook{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
.review-mode #reviewProgress{white-space:nowrap;font-size:10px}
.review-mode #reviewMenu{background:#e0e9e2;color:#25483b;padding:7px;font-size:12px;white-space:nowrap}
.review-mode .review-reference{display:block;flex:0 0 auto;max-height:25%;overflow:auto}
.review-mode #referenceToggle{width:100%;text-align:left;background:transparent;color:#3b6656;font-size:12px;padding:4px 7px}
.review-mode #referenceContent:not([hidden]){white-space:pre-wrap;max-height:90px;overflow:auto;background:#e8eee8;border-radius:7px;padding:7px;font:14px/1.35 Georgia,serif}
.review-mode .original-reference{display:none!important}
.review-mode .source{flex:0 1 39%;min-height:40px}
.review-mode .editor{flex:1 1 56%;min-height:65px}
.review-mode .reviewbar{position:relative;z-index:12}
.review-mode #reviewApprove{min-height:48px}
.review-mode #page{gap:5px}
.review-mode .reading{font-size:clamp(14px,2.2vw,18px);line-height:1.4}
.review-mode #final{font-size:16px;line-height:1.45}
.review-mode .brand{white-space:nowrap}
.review-mode header{padding-left:8px;padding-right:8px}
.review-mode #reviewToggle{margin-left:auto}
.review-mode.library-open aside{display:block;position:fixed;inset:44px 0 0;z-index:15;overflow:auto;background:#edf1ec;padding:14px}
.review-mode.library-open aside h3{display:block}
.review-mode.library-open aside>*{max-width:100%}
@media(max-width:600px){
 .review-mode header{height:40px}
 .review-mode .layout{height:calc(var(--review-vh,100dvh) - 40px)}
 .review-mode .brand{font-size:12px}
 .review-mode .brand strong{font-size:11px}
 .review-mode #reviewToggle{font-size:11px;padding:7px}
 .review-mode .review-top{font-size:11px}
 .review-mode #reviewProgress{display:none}
 .review-mode main{padding:3px 7px 0}
 .review-mode section{padding:6px 8px}
 .review-mode .source{flex:0 1 36%}
 .review-mode .editor{flex:1 1 64%}
 .review-mode .reviewbar{gap:5px}
 .review-mode #reviewPosition{display:none}
 .review-mode #reviewPrev,.review-mode #reviewNotes{min-height:46px;padding:10px}
 .review-mode #reviewApprove{font-size:15px}
}

/* V2.8: Dedicated keyboard-aware Spanish editing surface. */
.editbar{display:none}
body.review-mode.editing-mode{overflow:hidden;height:var(--review-vh,100dvh)}
.review-mode.editing-mode header,
.review-mode.editing-mode .review-top,
.review-mode.editing-mode .review-reference,
.review-mode.editing-mode .reviewbar,
.review-mode.editing-mode .source{display:none!important}
.review-mode.editing-mode .layout{height:var(--review-vh,100dvh)!important;min-height:0!important;max-height:var(--review-vh,100dvh)!important}
.review-mode.editing-mode main{height:100%;min-height:0;padding:6px 10px max(3px,env(safe-area-inset-bottom));display:flex;flex-direction:column;overflow:hidden}
.review-mode.editing-mode #page{flex:1 1 auto;min-height:0;overflow:hidden;display:flex!important}
.review-mode.editing-mode #page>section:not(.editor){display:none!important}
.review-mode.editing-mode #page>.editor{display:flex!important;flex:1 1 auto;min-height:0;height:100%;padding:5px;border:0;background:#f5f5f1;overflow:hidden}
.review-mode.editing-mode .editor>.sectiontitle:first-child{display:block;margin:0 0 5px;font-size:12px}
.review-mode.editing-mode #final{display:block!important;flex:1 1 auto;min-height:0!important;height:100%!important;max-height:none!important;width:100%;font-size:17px;line-height:1.5;padding:12px;overflow-y:auto;overscroll-behavior:contain;resize:none;scroll-margin:0}
.review-mode.editing-mode .editbar{display:flex;align-items:center;gap:8px;flex:0 0 auto;min-height:46px;padding:4px 0;background:#f5f5f1}
.review-mode.editing-mode #editPosition{font-size:12px;font-weight:700;color:#3a5c4c;white-space:nowrap}
.review-mode.editing-mode #editSaveStatus{font-size:11px;color:#64746a;flex:1;text-align:right}
.review-mode.editing-mode #editDone{background:#196747;color:white;font-size:16px;min-height:42px;min-width:110px}
@media(max-width:600px){.review-mode.editing-mode main{padding:3px 6px 2px}.review-mode.editing-mode #final{font-size:16px;padding:9px}.review-mode.editing-mode #editDone{min-width:94px}}

/* V2.9: Attach focused editor to the *visible* Safari viewport, not the
   document layout viewport. The toolbar stays directly above the keyboard. */
body.review-mode.editing-mode main{
  position:fixed!important;
  top:var(--review-top,0px)!important;
  left:0!important;right:0!important;
  width:100%!important;
  height:var(--review-vh,100dvh)!important;
  max-height:var(--review-vh,100dvh)!important;
  margin:0!important;
  padding:4px 10px max(4px,env(safe-area-inset-bottom))!important;
  z-index:100!important;
  background:#f5f5f1;
  display:flex!important;flex-direction:column!important;
  overflow:hidden!important;
}
body.review-mode.editing-mode #page{
  flex:1 1 0!important;min-height:0!important;height:auto!important;
  margin:0!important;overflow:hidden!important;
}
body.review-mode.editing-mode #page>.editor{
  flex:1 1 0!important;min-height:0!important;height:auto!important;
  margin:0!important;padding:2px!important;
  display:flex!important;flex-direction:column!important;
}
body.review-mode.editing-mode #final{
  flex:1 1 0!important;height:auto!important;min-height:0!important;
  margin:0!important;overflow-y:auto!important;
  -webkit-overflow-scrolling:touch;
}
body.review-mode.editing-mode .editbar{
  flex:0 0 auto!important;margin:0!important;
  padding:4px 0!important;min-height:50px!important;
}

/* V2.9.1: Full editor gets a keyboard-dismiss control, without approval. */
#fullEditorDone[hidden]{display:none!important}
#fullEditorDone{
 position:fixed!important;left:auto!important;right:14px!important;
 top:calc(var(--full-keyboard-bottom, 100dvh) - 54px)!important;
 z-index:9999!important;background:#196747!important;color:#fff!important;
 border:0!important;border-radius:10px!important;
 padding:11px 24px!important;min-height:44px!important;font-size:16px!important;
 box-shadow:0 2px 10px #0003!important;
}

/* V2.11: simple file actions, responsive across laptops, tablets and phones. */
aside .legacy-action{display:none!important}
aside .project-tools{margin-top:18px;border-top:1px solid #d2ddd4;padding-top:12px}
aside .project-tools summary{font-size:13px;font-weight:700;cursor:pointer;color:#365d4e;padding:10px 0}
aside .project-tools .hint{margin-bottom:8px}
.layout, main, aside, .editor, .reading{min-width:0}
button,select,input,textarea{max-width:100%}
@media(max-width:900px){.layout{grid-template-columns:235px minmax(0,1fr)}main{padding:15px 18px 32px}section{padding:16px}}
@media(max-width:760px){aside{display:block;padding:12px 16px}aside h3{display:block;margin:8px 0}aside label,aside .upload,aside button{margin:8px 0}aside .project-tools{margin:10px 0}main{padding:12px}header{padding:0 10px;gap:6px}.brand{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.brand small{display:none}#freshSession{display:none}.nav{gap:5px}.nav button{flex-shrink:0}}
@media(max-width:430px){.brand{font-size:13px}#reviewToggle{font-size:11px;padding:7px 8px}#connect{display:none}.reading{font-size:16px;line-height:1.55}section{padding:12px}.review-mode #reviewPrev,.review-mode #reviewNotes{font-size:12px;padding:9px 6px}.review-mode #reviewApprove{font-size:13px;padding:9px 6px}}

/* v2.11.2 — persistent filter visibility */
#activeFilterNotice[hidden]{display:none!important}
.active-filter-notice{background:#fff2d4;color:#593d09;border:1px solid #e6c781;border-radius:9px;padding:10px 12px;font-size:13px;font-weight:700;line-height:1.4;margin:10px 0;overflow-wrap:anywhere}

/* v2.11.3 welcome screen */
.welcome[hidden]{display:none!important}.welcome{max-width:650px;margin:7vh auto 2rem;padding:clamp(20px,5vw,54px);text-align:center;border:1px solid #d6e0d9;background:#fff;border-radius:22px;box-shadow:0 8px 35px #203f3512}.welcome h1{font-size:clamp(25px,4vw,36px);margin:15px 0}.welcome p{line-height:1.6}.welcome-icon{margin:auto;width:86px;height:86px;border-radius:22px;background:#193e37;color:#e6f5e9;display:grid;place-items:center;font-weight:800;font-size:24px}.welcome-upload{display:inline-block!important;margin:20px auto!important;padding:14px 25px!important}.welcome .hint{font-size:13px;color:#60766b}@media(max-width:700px){.welcome{margin:15px 10px;padding:24px 16px}}

/* V2.11.4: first-visit onboarding occupies the first screen on all devices. */
body.no-project .layout{display:block!important;max-width:none;min-height:calc(100dvh - 62px);height:auto!important}
body.no-project aside,body.no-project main>.nav,body.no-project main>.bottom,body.no-project .review-top,body.no-project .review-reference,body.no-project .reviewbar,body.no-project .editbar{display:none!important}
body.no-project main{display:block!important;max-width:850px;width:100%;height:auto!important;min-height:0!important;overflow:visible!important;margin:0 auto;padding:clamp(12px,3vw,32px)!important}
body.no-project #welcome{display:block;max-width:680px;margin:0 auto 20px}
body.no-project #welcome[hidden]{display:none!important}
body.no-project #page{display:none!important}
body.no-project{overflow:auto!important}
@media(max-width:760px){body.no-project .layout{min-height:calc(100dvh - 52px)}body.no-project main{padding:12px!important}body.no-project #welcome{margin:0 auto;padding:clamp(18px,5vw,28px);border-radius:16px}body.no-project #welcome h1{font-size:clamp(23px,6vw,30px);line-height:1.2}body.no-project #welcome p{margin:12px 0;line-height:1.45}body.no-project .welcome-icon{width:64px;height:64px;font-size:20px}body.no-project .welcome-upload{margin:12px auto!important;min-height:48px}}
