#study-root{display:none;flex:1;min-height:0;overflow:hidden;color:var(--text,#253627)}body[data-workspace=study] #study-root{display:flex;flex-direction:column;height:calc(100dvh - var(--toolbar-height,64px))}body[data-workspace=study] #layout,body[data-workspace=study] .canvas-controls,body[data-workspace=study] #write-format-toolbar{display:none!important}#study-root button{cursor:pointer}#study-root button svg,#study-module svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.study-tools{padding:10px 20px;display:flex;gap:6px;align-items:center;flex-wrap:wrap;border-bottom:1px solid var(--border,#dfe3dd)}.study-tools button,.study-tools summary{padding:7px;border-radius:6px;border:0;background:transparent;color:inherit}.study-tools button:hover,.study-tools summary:hover{background:var(--hover,#e6ece7)}.study-tools details{position:relative}.study-tools details>div{position:absolute;top:100%;z-index:12;background:var(--panel,#fff);padding:14px;border:1px solid var(--border,#ddd);border-radius:8px;width:240px;box-shadow:0 6px 20px #0002}.study-tools label{display:block;margin:8px 0}.study-tools [aria-pressed=true]{background:#dde9df}.study-reference{margin-right:auto;font-size:14px}.study-reference small{display:block;opacity:.7}.study-body{position:relative;display:flex;flex:1;min-height:0;overflow:hidden}.study-scroll{overflow:auto;flex:1;min-width:0;padding:36px 28px;position:relative}.study-page{position:relative;min-height:100%;padding:16px 50px 100px 10px}.study-line{position:relative;margin:0 0 12px;padding-left:calc(var(--level)*var(--indent));line-height:1.95;font-family:"Source Serif 4",Georgia,serif;font-size:21px}.study-line-text{display:block;white-space:pre-wrap;overflow-wrap:anywhere;padding-left:22px}.study-handle{position:absolute;left:calc(var(--level)*var(--indent) - 12px);top:5px;border:0;background:transparent;color:#859587;padding:4px;touch-action:none;border-radius:5px}.study-line.selected .study-handle{background:#dce8df;color:#253627}.study-gap{cursor:vertical-text;position:relative}.study-gap:hover:before{content:'';position:absolute;top:-5px;bottom:-4px;left:50%;border-left:1px dashed #708c76;pointer-events:none}.study-word{position:relative;scroll-margin:70px}.study-word.comment-active{box-shadow:0 2px 0 #bfa95c;background:#eadfb533}.study-verse{font-size:.6em;color:#768778;vertical-align:super}.study-hide-verses .study-verse{font-size:0;width:0;display:inline-block}.study-comment-indicator{font:10px Inter,system-ui;border:0;color:#6c744c;background:#ebe7d1;border-radius:8px;padding:1px 4px;vertical-align:super;user-select:none;margin:0 2px}
.study-comment-indicator{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;margin:0 4px;padding:0;border-radius:0;background:transparent;color:#b45309;vertical-align:middle;cursor:pointer}.study-comment-indicator svg{width:24px;height:24px;fill:color-mix(in srgb,currentColor 30%,transparent);stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}.study-comment-indicator:hover{color:#7c2d12}.study-comment-indicator:hover svg{transform:scale(1.1)}
html body .study-comment-indicator[data-type]{color:var(--type-color)!important}html body .study-comment-indicator[data-type]:hover{filter:brightness(.85)}
body.app-dark .study-comment-indicator{color:#fbbf24}body.app-dark .study-comment-indicator:hover{color:#fde68a}.study-enclose{border:1px solid currentColor;border-radius:3px;padding:0 2px}.study-label{font:10px Inter,system-ui;background:var(--panel,#fff);color:#8b7b39;display:inline;vertical-align:super;padding:0 3px;user-select:none}.study-arrows{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}.study-arrows path.arrow-hit{stroke:transparent;stroke-width:22;fill:none;pointer-events:stroke;cursor:pointer}.study-arrows path.arrow-visible{fill:none;stroke-width:1.8;pointer-events:none;opacity:.85}.study-arrows text{font:12px Inter,system-ui}.study-comment-panel{width:360px;min-width:260px;max-width:70%;border-left:1px solid var(--border,#ddd);overflow:auto;background:var(--panel,#fafbf9);position:relative;padding:12px;flex:none}.study-resizer{position:absolute;left:0;top:0;height:100%;width:7px;cursor:col-resize;touch-action:none}.study-comment-card{border:1px solid var(--border,#dde1db);border-radius:8px;margin:12px 0;padding:12px}.study-comment-card.active{border-color:#a38d49}.study-comment-editor .tiptap{min-height:120px;outline:0;font:16px/1.6 Inter,system-ui;padding:10px 0;color:inherit}.study-comment-formats{display:flex;flex-wrap:wrap;gap:4px}.study-comment-formats button{font:12px Inter,system-ui;border:0;background:transparent;color:inherit;padding:5px}.study-comment-search{width:100%;margin:8px 0}.study-comment-command-list{max-height:180px;overflow:auto;display:flex;flex-direction:column}.study-empty{max-width:600px;margin:35px auto;padding:24px}.study-empty textarea{width:100%;min-height:220px;resize:vertical}.study-empty label{display:block;margin:12px 0}.study-empty input{width:100%}.study-guide{position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(90deg,transparent 0,transparent calc(var(--indent) - 1px),#899b7b33 calc(var(--indent) - 1px),#899b7b33 var(--indent))}.study-drag-preview{outline:1px dashed #76987d}.study-arrow-preview{stroke-dasharray:4 3}.study-status{font:12px Inter,system-ui;padding:5px 20px;min-height:22px}.study-arrow-editor{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 20px;font-size:13px;background:var(--panel,#fff)}.study-arrow-editor input[type=range]{width:110px}@media(max-width:750px){.study-scroll{padding:22px 12px}.study-comment-panel{position:absolute;right:0;top:0;bottom:0;z-index:20;max-width:94%;width:360px;box-shadow:-8px 0 30px #0002}.study-line{font-size:19px}.study-page{padding-right:25px}.study-resizer{display:none}}body.app-dark #study-root{--panel:#24282e;--border:#41474e;--hover:#333a40;--text:#f2f3f4;color:#f2f3f4}body.app-dark .study-tools [aria-pressed=true],body.app-dark .study-line.selected .study-handle{background:#3e4943;color:#fff}body.app-dark .study-label{color:#e4d294}body.app-dark .study-verse{color:#a7b9aa}

body[data-workspace=study] #toggle-outline{display:none!important}body[data-workspace=study] #study-module[aria-current=page]{color:var(--accent,#365c3e);font-weight:600}

.study-arrow-editor[hidden],.study-comment-panel[hidden]{display:none!important}

body[data-workspace=study]{overflow:hidden}.study-tools,.study-status,.study-arrow-editor{flex-shrink:0}.study-empty{overflow:auto}
.study-line{line-height:var(--study-leading,1.95)}.study-hide-handles .study-handle{visibility:hidden}.study-extra-room .study-line{margin-bottom:34px}.study-heading{display:block;font:600 22px/1.4 Inter,system-ui;padding:12px 22px;border:0;background:transparent;color:inherit;text-align:start}.study-heading.level-1{font-size:19px}.study-heading.level-2{font-size:17px}.study-heading.level-3{font-size:15px}.study-selection{background:#c9dcd755}.study-magnetic-target{background:#bdddd866;outline:2px solid #527f73;border-radius:3px}.study-connected-word{background:#dfd5a566;box-shadow:0 2px 0 #a58d47}.study-tools summary{list-style:none;cursor:pointer}.study-tools summary::-webkit-details-marker{display:none}.study-mark-buttons button{display:inline-flex}.study-arrow-handle-hit{fill:transparent;pointer-events:all;cursor:grab;touch-action:none}.study-arrow-handle{fill:var(--panel,#fff);stroke:#638c7d;stroke-width:1.5;pointer-events:none}.study-arrows .arrow-visible{stroke-width:inherit}.study-arrow-label{fill:var(--text,#253627);stroke:var(--panel,#fff);stroke-width:5px;paint-order:stroke fill;pointer-events:all;cursor:move;user-select:none}.study-color-swatch{width:22px;height:22px;border-radius:4px;border:3px solid var(--panel,#fff)}#study-offscreen{position:sticky;top:0;z-index:12;background:var(--panel,#fff);font:12px Inter,system-ui}#study-offscreen button{display:block}#study-word-actions{width:210px;padding:8px;z-index:100;background:var(--panel,#fff);border:1px solid var(--border,#ddd);border-radius:8px}#study-word-actions button{display:block;width:100%;border:0;background:transparent;color:inherit;padding:7px;text-align:start}.study-clear-view .study-comment-indicator,.study-clear-view .study-label{display:none!important}.study-arrow-editor button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8}.study-tools .study-cards-menu>div button{display:block;width:100%;text-align:start}
.study-tools{user-select:none;-webkit-user-select:none}.study-tools .study-cards-menu>div{left:auto;right:0;max-width:min(240px,calc(100vw - 24px))}
@media(pointer:coarse){.study-tools button,.study-tools summary,.study-arrow-editor button{min-height:44px;min-width:44px}.study-arrows .arrow-hit{stroke-width:30}}@media(prefers-reduced-motion:reduce){#study-root *{transition:none!important;animation:none!important;scroll-behavior:auto!important}}@media(forced-colors:active){.study-arrows .arrow-visible{stroke:CanvasText}.study-arrow-label{fill:CanvasText;stroke:Canvas}.study-selection,.study-magnetic-target{outline:2px solid Highlight}}
.study-add-heading{position:absolute;left:calc(var(--level)*var(--indent) - 40px);top:5px;border:0;background:transparent;color:#859587;padding:4px;border-radius:5px;cursor:pointer;opacity:.55}.study-add-heading:hover,.study-add-heading:focus-visible{opacity:1;background:#dce8df;color:#253627}.study-add-heading svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.study-hide-handles .study-add-heading{visibility:hidden}body.app-dark .study-add-menu{background:#2b322e;border-color:#444}body.app-dark .study-add-heading:hover{background:#3e4943;color:#fff}
.study-page{padding-left:72px}@media(max-width:750px){.study-page{padding-left:56px}}@media(hover:hover){.study-handle,.study-add-heading{opacity:0;transition:opacity .12s}.study-line:hover .study-handle,.study-line:hover .study-add-heading,.study-handle:focus-visible,.study-add-heading:focus-visible{opacity:1}.study-line:hover .study-add-heading{opacity:.6}.study-line .study-add-heading:hover{opacity:1}}
.study-add-wrap{position:absolute;left:calc(var(--level)*var(--indent) - 40px);top:5px;z-index:5}.study-add-wrap:hover,.study-add-wrap:focus-within,.study-add-wrap.open{z-index:50}.study-add-heading{position:static!important}.study-add-menu{display:none;position:absolute;left:0;top:100%;flex-direction:column;min-width:120px;background:var(--panel,#fff);border:1px solid var(--border,#ddd);border-radius:8px;box-shadow:0 6px 20px #0002;padding:4px}.study-add-wrap:hover .study-add-menu,.study-add-wrap:focus-within .study-add-menu,.study-add-wrap.open .study-add-menu{display:flex}.study-add-menu button{border:0;background:transparent;color:inherit;text-align:start;padding:7px 14px;border-radius:5px;cursor:pointer;font:14px Inter,system-ui;white-space:nowrap}.study-add-menu button:hover{background:var(--hover,#e6ece7)}.study-hide-handles .study-add-wrap{visibility:hidden}.study-heading-row{display:flex;align-items:center;gap:2px}input.study-heading{display:block;width:min(100%,640px);box-sizing:border-box;border-bottom:1px solid #638c7d;outline:0;margin:0}input.study-heading::placeholder{opacity:.4}.study-heading-edit{margin:0 0 4px}
#study-root input.study-heading,#study-root input.study-heading:focus,#study-root input.study-heading:focus-visible{background:transparent;border:0;border-bottom:1px solid #638c7d!important;border-radius:0;box-shadow:none!important;outline:none!important;color:inherit;padding:12px 22px 6px}
#study-root .study-heading{text-transform:uppercase;font-family:Inter,system-ui;font-size:30px;font-weight:800;letter-spacing:.1em;line-height:1.25}#study-root .study-heading.level-1{font-size:24px;font-weight:700;letter-spacing:.08em}#study-root .study-heading.level-2{font-size:19px;font-weight:700;letter-spacing:.1em}#study-root .study-heading.level-3{font-size:15px;font-weight:600;letter-spacing:.14em;opacity:.85}

.study-heading-delete{border:0;background:transparent;color:inherit;padding:4px;border-radius:5px;cursor:pointer;opacity:0;transition:opacity .12s}.study-heading-delete svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.study-heading-row:hover .study-heading-delete,.study-heading-delete:focus-visible{opacity:.6}.study-heading-row .study-heading-delete:hover{opacity:1;color:#a13d3d;background:var(--hover,#e6ece7)}body.app-dark .study-heading-row .study-heading-delete:hover{color:#f0a0a0}
@media(hover:none){.study-handle,.study-add-heading{opacity:0;transition:opacity .12s}.study-line.touch-active .study-handle,.study-line.touch-active .study-add-heading{opacity:1}.study-heading-delete{opacity:.5}}
.study-hide-verses .study-verse+.study-gap{display:none}
.study-join-preview{opacity:.55;transform:translateY(-10px);transition:transform .1s,opacity .1s}
.study-tools .study-swatch{display:inline-block;width:14px;height:14px;border-radius:3px;border:1px solid #0003;margin-right:8px;vertical-align:-2px}.study-highlight-menu>div{width:auto!important;min-width:170px;padding:6px!important}.study-highlight-menu>div button{display:block;width:100%;text-align:start;padding:7px 10px;font:14px Inter,system-ui;border-radius:5px;white-space:nowrap}.study-reference-button{display:inline-flex;align-items:center;gap:4px;border:0;background:transparent;color:inherit;padding:2px 6px;margin:-2px -6px;border-radius:6px;cursor:pointer;font:inherit}.study-reference-button:hover{background:var(--hover,#e6ece7)}.study-reference-button svg{width:14px!important;height:14px!important;opacity:.6}.study-reference-form label,.study-reference-row{display:flex;align-items:center;gap:8px;margin:10px 0}.study-reference-form label{justify-content:space-between}.study-reference-form select{min-width:90px}.study-reference-form [data-status]{min-height:1.4em;font-size:13px;opacity:.8}.study-enclose{border:0!important;border-radius:0!important;padding:1px 0!important;border-top:1px solid var(--study-enclose-color,currentColor)!important;border-bottom:1px solid var(--study-enclose-color,currentColor)!important}.study-enclose-start{border-left:1px solid var(--study-enclose-color,currentColor)!important;border-radius:3px 0 0 3px!important;padding-left:3px!important}.study-enclose-end{border-right:1px solid var(--study-enclose-color,currentColor)!important;border-radius:0 3px 3px 0!important;padding-right:3px!important}.study-enclose-start.study-enclose-end{border-radius:3px!important}
/* Indent, outdent and join buttons are hidden; drag handles instead. */
.study-tools [data-study-action=outdent],.study-tools [data-study-action=indent],.study-tools [data-study-action=join]{display:none}
.study-level-wrap{position:relative}.study-level-btn{border:0;background:transparent;color:inherit;font:600 12px Inter,system-ui;padding:4px 6px;border-radius:5px;cursor:pointer;opacity:0;transition:opacity .12s}.study-heading-row:hover .study-level-btn,.study-level-btn:focus-visible,.study-level-wrap:focus-within .study-level-btn{opacity:.6}.study-level-btn:hover{opacity:1!important;background:var(--hover,#e6ece7)}.study-level-wrap:hover .study-add-menu,.study-level-wrap:focus-within .study-add-menu{display:flex}.study-level-wrap .study-add-menu{z-index:10}.study-add-menu button.current{font-weight:700}.study-heading-row .study-heading{flex:0 1 auto}
.study-arrow-tools{display:inline-flex;align-items:center;gap:8px;margin-left:6px;padding-left:10px;border-left:1px solid var(--border,#ddd)}.study-arrow-tools[hidden]{display:none}.study-arrow-hint{font:13px Inter,system-ui;opacity:.8;white-space:nowrap}
.study-style-picker{position:relative;display:inline-block}.study-style-picker>summary,.study-arrow-more>summary{display:inline-flex;align-items:center;gap:6px;cursor:pointer;list-style:none;padding:4px 8px;border-radius:6px;font:13px Inter,system-ui;min-height:28px}.study-style-picker>summary::-webkit-details-marker,.study-arrow-more>summary::-webkit-details-marker{display:none}.study-style-picker>summary::after{content:'\25BE';opacity:.6}.study-style-picker>summary:hover,.study-arrow-more>summary:hover{background:var(--hover,#e6ece7)}.study-style-picker i,.study-style-row i{display:inline-block;width:10px;height:10px;border-radius:50%;flex:none}.study-arrow-more{position:relative}.study-arrow-more svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8}
.study-style-menu{position:absolute;top:100%;left:0;z-index:40;min-width:230px;display:flex;flex-direction:column;gap:2px;background:var(--panel,#fff);border:1px solid var(--border,#ddd);border-radius:8px;box-shadow:0 6px 20px #0002;padding:6px;font:13px Inter,system-ui;text-align:start}.study-arrow-float .study-arrow-more .study-style-menu{left:auto;right:0;min-width:170px}.study-style-menu>button,.study-style-row>button{display:flex;align-items:center;gap:8px;border:0;background:transparent;color:inherit;text-align:start;padding:6px 10px;border-radius:5px;cursor:pointer;font:13px Inter,system-ui;min-height:0;min-width:0}.study-style-menu>button:hover,.study-style-row>button:hover{background:var(--hover,#e6ece7)}.study-style-menu .current{font-weight:700}.study-style-row{display:flex;align-items:center}.study-style-row>button:first-child{flex:1}.study-style-row svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8}.study-style-row .armed{color:#a13d3d;font-weight:600}.study-style-colors{display:flex;align-items:center;gap:6px;padding:4px 6px 8px}.study-style-colors .study-color-swatch{width:22px;height:22px;min-width:22px;min-height:22px;padding:0;cursor:pointer}.study-style-form{display:flex;flex-direction:column;gap:8px;padding:4px}.study-style-form label{display:flex;justify-content:space-between;align-items:center;gap:10px}.study-style-form input[name=name]{width:130px}.study-style-actions{display:flex;justify-content:flex-end;gap:8px}
.study-arrow-help{position:relative;display:inline-flex}.study-arrow-help>button{border-radius:50%;width:24px;height:24px;min-width:24px;min-height:24px;padding:0;font:600 13px Inter,system-ui}.study-arrow-tip{display:none;position:absolute;top:100%;right:0;z-index:40;width:260px;padding:10px 12px;background:var(--panel,#fff);border:1px solid var(--border,#ddd);border-radius:8px;box-shadow:0 6px 20px #0002;font:13px/1.45 Inter,system-ui;white-space:normal}.study-arrow-help:hover .study-arrow-tip,.study-arrow-help:focus-within .study-arrow-tip{display:block}
.study-arrow-float{position:absolute;z-index:20;transform:translate(-50%,0);display:flex;align-items:center;gap:2px;padding:4px;background:var(--panel,#fff);border:1px solid var(--border,#ddd);border-radius:10px;box-shadow:0 6px 20px #0003;white-space:nowrap}.study-arrow-float[hidden]{display:none}.study-arrow-float>button{border:0;background:transparent;color:inherit;padding:5px;border-radius:6px;cursor:pointer}.study-arrow-float>button:hover{background:var(--hover,#e6ece7)}.study-arrow-float>button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.study-arrow-float>button[data-study-action=arrow-delete]:hover{color:#a13d3d}
#study-root .study-arrows .study-arrow-label{font-size:24px;stroke-width:12px;stroke-linejoin:round}.study-page .study-arrows{z-index:6}
#study-root .study-arrows .arrow-visible{opacity:.6}#study-root .study-arrows .study-arrow-label-bg{fill-opacity:.6}
#study-root .study-arrows .study-arrow-label-bg,#study-root .study-arrows .study-arrow-label-text{pointer-events:all;cursor:move;user-select:none}#study-root .study-arrows .study-arrow-label-text{stroke:none;font-size:24px;font-weight:600}
#study-arrow-tools .study-arrow-hide{display:inline-flex;align-items:center;justify-content:center;min-width:28px;min-height:28px}#study-arrow-tools .study-arrow-hide svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8}
#study-arrow-tools .study-arrow-hide[aria-pressed=true]{background:var(--hover,#e6ece7);border-radius:6px}

.study-color-menu summary{display:flex;align-items:center;gap:5px}.study-color-menu .study-custom-color{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid var(--border,#ddd);padding:8px 10px;margin:4px 0 0;font:14px Inter,system-ui;white-space:nowrap}.study-custom-color input{width:32px;height:26px;padding:0;border:0;background:transparent}.tb-fold-panel .study-color-menu summary{font:14px Inter,system-ui}

.study-tools>.study-color-menu>div{left:0;top:100%}

/* Keep toolbar buttons and dropdown triggers on the same icon centerline. */
.study-tools>button,.study-tools>details>summary{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:34px;padding:7px;margin-block:0;line-height:1}
.study-tools>button>svg,.study-tools>details>summary>svg{display:block;flex-shrink:0}
/* The diagram bar is a shared-engine bar (study/toolbar.js); folded controls list inside a panel. */
.study-tools .tb-fold-panel{overflow:visible;max-height:none;min-width:200px}
.study-tools .tb-fold-panel>.tb-item,.study-tools .tb-fold-panel>details>summary{display:flex;align-items:center;justify-content:flex-start;gap:8px;width:100%;height:auto;min-height:32px;text-align:left}
.study-tools .tb-fold-panel .study-color-menu>div{left:100%;top:0}
.study-tools .tb-fold>summary,.study-tools .tb-more>summary{display:inline-flex;align-items:center;gap:2px}
.study-tools .tb-caret{width:12px;height:12px}
/* Text Work: always-visible line handles, clearer split point, first-use steps, labelled toolbar sections. */
#study-root .study-handle,#study-root .study-add-heading,#study-root .study-level-btn,#study-root .study-heading-delete{opacity:.55}
#study-root .study-line:hover .study-handle,#study-root .study-line.selected .study-handle,#study-root .study-handle:focus-visible,#study-root .study-line:hover .study-add-heading,#study-root .study-add-heading:focus-visible,#study-root .study-level-btn:focus-visible{opacity:1}
#study-root .study-handle:focus-visible,#study-root .study-add-heading:focus-visible{outline:2px solid var(--accent,#365c3e);outline-offset:1px}
#study-root .study-gap:hover:before{border-left:2px solid var(--accent,#365c3e);top:-7px;bottom:-6px}
#study-root .study-gap:hover:after{content:'Split';position:absolute;left:50%;top:-26px;transform:translateX(-50%);padding:1px 7px;border-radius:4px;background:var(--accent,#365c3e);color:var(--on-accent,#fff);font:600 11px/1.6 Inter,system-ui;white-space:nowrap;pointer-events:none;z-index:3}
.study-tips-dialog{max-width:min(460px,calc(100vw - 32px));padding:20px 24px;border:1px solid var(--border,#dfe3dd);border-radius:12px;background:var(--panel,#fff);color:inherit;font:14px/1.5 Inter,system-ui}
.study-tips-dialog h2{margin:0 0 8px;font:600 18px Inter,system-ui}
.study-tips-dialog ul{margin:0 0 8px;padding-left:20px}
.study-tips-dialog li{margin:4px 0}
.study-tips-dialog button{margin-top:8px;padding:8px 18px;border:0;border-radius:8px;background:var(--accent,#365c3e);color:var(--on-accent,#fff);font:600 14px Inter,system-ui;cursor:pointer}
@media(pointer:coarse){.study-tips-dialog button{min-height:44px}}
.study-status:empty{display:none}
.study-tools .study-section-label{align-self:center;margin-left:8px;padding-left:12px;border-left:1px solid var(--line,#e5e5e7);font:500 12px/1 Inter,system-ui;color:var(--muted,#62666d);white-space:nowrap}
.study-tools.tb-bar .tb-text>.tb-label,.study-tools.tb-bar .tb-text>summary>.tb-label{margin-left:6px;font:13px Inter,system-ui;white-space:nowrap}
@media(max-width:1000px){.study-tools.tb-bar .tb-text>.tb-label,.study-tools.tb-bar .tb-text>summary>.tb-label{display:none}}
.study-tools .study-diagram-menu>summary{gap:6px}
.study-tools .study-diagram-menu>div{left:auto;right:0;width:auto;min-width:210px;padding:6px}
.study-tools .study-diagram-menu>div>button{display:flex;align-items:center;gap:10px;width:100%;min-height:36px;padding:7px 10px;text-align:left}
.study-tools .study-diagram-menu>div>.study-danger{margin-top:4px;border-top:1px solid var(--border,#ddd);border-radius:0 0 6px 6px;color:#a13d3d}
body.app-dark .study-tools .study-diagram-menu>div>.study-danger{color:#f0a0a0}
.study-menu-text{font:14px Inter,system-ui}
.study-status.study-mode-on{padding:8px 20px;border-left:4px solid var(--accent,#365c3e);background:color-mix(in srgb,var(--accent,#365c3e) 14%,transparent);font-weight:600}
.study-tools .study-diagram-menu>div>button .study-menu-text{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left}
.study-tools .study-diagram-menu>div>button .study-menu-text b{font:600 14px Inter,system-ui}
.study-tools .study-diagram-menu>div>button .study-menu-text small{font:12px/1.35 Inter,system-ui;opacity:.75;white-space:normal;max-width:240px}
.study-tools .study-diagram-menu>div>button>svg{align-self:flex-start;margin-top:2px}
.study-arrow-cancel{font:13px Inter,system-ui;white-space:nowrap}
.study-setting-group{margin:0 0 10px;padding:0;border:0}
.study-setting-group legend{padding:0 0 2px;font:600 11px Inter,system-ui;letter-spacing:.06em;text-transform:uppercase;opacity:.65}
.study-setting-group select,.study-setting-group input[type=range]{display:block;width:100%;margin-top:4px}
.study-page.study-comfortable-width .study-line-text{max-width:70ch}
.header-metadata-date{position:relative}
.header-metadata-date:has(#header-date-input[data-empty="1"]:not(:focus))::after{content:"Unscheduled";position:absolute;left:2px;top:3px;font:italic 12px/18px Inter,system-ui;color:var(--muted);pointer-events:none}
#header-date-input[data-empty="1"]:not(:focus)::-webkit-datetime-edit{opacity:0}

.study-tools .study-reference{flex-shrink:0;white-space:nowrap}

/* Text Work toolbar: quiet groups, consistent targets and readable folded actions. */
.study-tools.tb-bar{gap:4px;padding:10px 20px;min-height:60px;box-sizing:border-box;color:var(--ink,#252629);border-bottom-color:var(--line,#e5e5e7)}
.study-tools.tb-bar>button,.study-tools.tb-bar>details>summary{min-width:36px;height:36px;padding:8px;border-radius:6px;font:13px/1 Inter,system-ui;transition:background-color 120ms ease,color 120ms ease}
.study-tools.tb-bar>details>summary{gap:4px}
.study-tools.tb-bar button:focus-visible,.study-tools.tb-bar summary:focus-visible{outline:2px solid var(--focus-ring,#658a6d);outline-offset:2px}
.study-tools.tb-bar>button:disabled{opacity:.4;cursor:default;background:transparent}
.study-tools.tb-bar [aria-pressed=true],.study-tools.tb-bar>details[open]>summary{background:var(--accent-soft,#e9f0ea);color:var(--accent-ink,#36563d)}
.study-tools.tb-bar .tb-text>.tb-label,.study-tools.tb-bar .tb-text>summary>.tb-label{margin-left:2px}
.study-tools.tb-bar .study-reference{margin-right:auto;padding-right:12px;line-height:1.5}
.study-tools.tb-bar .study-reference small{font:12px/1.5 Inter,system-ui;color:var(--muted,#62666d);opacity:1;margin-top:2px}
.study-tools.tb-bar .study-diagram-menu>div{width:290px;min-width:0;max-width:calc(100vw - 24px);padding:6px}
.study-tools.tb-bar .study-diagram-menu>div>button{padding:10px;gap:12px;border-radius:6px}
.study-tools.tb-bar .study-diagram-menu>div>button .study-menu-text small{color:var(--muted,#62666d);opacity:1;line-height:1.5}
.study-tools.tb-bar .tb-fold-panel .tb-item>.tb-label,.study-tools.tb-bar .tb-fold-panel .tb-item>summary>.tb-label{display:inline;margin-left:0;white-space:normal;line-height:1.4}
.study-tools.tb-bar .tb-fold-panel>.tb-item,.study-tools.tb-bar .tb-fold-panel>details>summary{min-height:36px;padding:8px;gap:8px}
@media(max-width:1280px){.study-tools.tb-bar .study-section-label{font-size:0;width:0;height:20px;margin-left:4px;padding-left:4px}}
@media(max-width:600px){.study-tools.tb-bar{padding:8px;gap:2px}.study-tools.tb-bar .study-section-label{margin-left:2px;padding-left:2px}.study-tools.tb-bar .study-reference{padding-right:4px}.study-tools.tb-bar .tb-fold-panel .study-color-menu>div{left:auto;right:0;top:100%;max-width:calc(100vw - 24px);box-sizing:border-box}}
@media(pointer:coarse){.study-tools.tb-bar>button,.study-tools.tb-bar>details>summary,.study-tools.tb-bar .tb-fold-panel>.tb-item,.study-tools.tb-bar .tb-fold-panel>details>summary{min-height:44px;min-width:44px}}
body.app-dark .study-tools.tb-bar [aria-pressed=true],body.app-dark .study-tools.tb-bar>details[open]>summary{background:var(--hover,#333a40);color:var(--ink,#f2f3f4)}

/* Two-level Text Work tools: section labels sit above their own controls. */
.study-tools.tb-bar.study-grouped-toolbar{align-items:flex-end;flex-wrap:wrap;gap:8px 12px;padding:10px 20px;min-height:82px}
.study-grouped-toolbar>.study-reference{align-self:center;flex:1 1 160px;min-width:100px}
.study-grouped-toolbar>.study-tool-group{display:flex;flex-direction:column;gap:5px;min-width:0;max-width:100%;padding:0 12px;border-left:1px solid var(--line,#e5e5e7)}
.study-grouped-toolbar>.study-tool-group-format{flex:0 1 250px}
.study-grouped-toolbar>.study-tool-group-annotation{flex:0 1 280px}
.study-grouped-toolbar .study-tool-group-label{display:block;font:500 12px/1.25 Inter,system-ui;color:var(--muted,#62666d);padding-left:8px;white-space:nowrap}
.study-grouped-toolbar .study-group-controls{display:flex;flex-wrap:nowrap;align-items:center;gap:4px;min-width:0;width:100%}
.study-grouped-toolbar .study-group-controls>button,.study-grouped-toolbar .study-group-controls>details>summary{display:inline-flex;align-items:center;justify-content:center;gap:4px;box-sizing:border-box;height:36px;min-width:36px;padding:8px;border-radius:6px;font:13px/1 Inter,system-ui}
.study-grouped-toolbar .study-group-controls>.tb-text>.tb-label,.study-grouped-toolbar .study-group-controls>.tb-text>summary>.tb-label{display:none}
.study-grouped-toolbar .study-group-controls>.tb-more>summary::after{content:'More';font:13px Inter,system-ui}
.study-grouped-toolbar .study-group-controls .tb-fold-panel{left:auto;right:0;min-width:210px;max-width:calc(100vw - 24px)}
.study-grouped-toolbar .study-group-controls .tb-fold-panel .tb-label{display:inline!important}
.study-grouped-toolbar .study-group-controls .tb-fold-panel>.tb-item{display:flex;align-items:center;justify-content:flex-start;gap:8px;min-height:36px;width:100%;text-align:left}
.study-grouped-toolbar .study-group-controls .tb-fold-panel>details>summary{display:flex;align-items:center;gap:8px;min-height:36px;width:100%}
@media(pointer:coarse){.study-grouped-toolbar .study-group-controls>button,.study-grouped-toolbar .study-group-controls>details>summary{min-width:44px;min-height:44px}}
@media(max-width:800px){.study-tools.tb-bar.study-grouped-toolbar{gap:8px;padding:10px 12px}.study-grouped-toolbar>.study-reference{flex-basis:calc(100% - 250px)}.study-grouped-toolbar>.study-tool-group-format{flex:1 1 240px}.study-grouped-toolbar>.study-tool-group-annotation{flex:1 1 240px}}
@media(max-width:520px){.study-grouped-toolbar>.study-tool-group-format,.study-grouped-toolbar>.study-tool-group-annotation{flex:1 1 100%;border-left:0;padding:0}.study-grouped-toolbar>.study-reference{flex:1 1 100%;padding:0}.study-grouped-toolbar .study-group-controls{justify-content:flex-start}.study-tools.tb-bar.study-grouped-toolbar{gap:10px}}

/* Folded controls use menu rows, not nested toolbar spacing. */
.study-tools.tb-bar .study-group-controls .tb-fold-panel{width:232px;min-width:0;padding:6px;gap:2px;box-sizing:border-box}
.study-tools.tb-bar .study-group-controls .tb-fold-panel>details.tb-item{display:block;width:100%;padding:0;min-height:0}
.study-tools.tb-bar .study-group-controls .tb-fold-panel>button.tb-item,.study-tools.tb-bar .study-group-controls .tb-fold-panel>details.tb-item>summary{display:grid;grid-template-columns:18px minmax(0,1fr) 10px;align-items:center;gap:10px;width:100%;min-height:40px;height:auto;padding:9px 10px;box-sizing:border-box;border-radius:5px;text-align:left;font:13px/1.4 Inter,system-ui}
.study-tools.tb-bar .study-group-controls .tb-fold-panel .tb-item>.tb-label,.study-tools.tb-bar .study-group-controls .tb-fold-panel .tb-item>summary>.tb-label{margin:0;white-space:normal;line-height:1.4}
.study-tools.tb-bar .study-group-controls .tb-fold-panel>details>summary>span[aria-hidden=true]{display:none}
.study-tools.tb-bar .study-group-controls .tb-fold-panel>details>summary::after{content:'';width:6px;height:6px;border-top:1.5px solid currentColor;border-right:1.5px solid currentColor;transform:rotate(45deg);justify-self:center;opacity:.65}
.study-tools.tb-bar .study-group-controls .tb-fold-panel>details[open]>summary::after{transform:rotate(135deg)}
.study-tools.tb-bar .study-group-controls .tb-fold-panel>details[open]>summary{background:var(--hover,#e6ece7)}
.study-tools.tb-bar .study-group-controls .tb-fold-panel>details>div{position:static;width:100%;min-width:0;max-width:none;padding:4px 6px 6px 28px!important;border:0;border-radius:0;box-shadow:none;background:transparent;box-sizing:border-box}
.study-tools.tb-bar .study-group-controls .tb-fold-panel>button[data-study-action=clear-markup]{margin-top:4px;border-top:1px solid var(--line,#e5e5e7);border-radius:0 0 5px 5px}
@media(pointer:coarse){.study-tools.tb-bar .study-group-controls .tb-fold-panel>button.tb-item,.study-tools.tb-bar .study-group-controls .tb-fold-panel>details.tb-item>summary{min-height:44px}}

/* Text Work toolbar, second pass: actions menu beside the reference, direct formatting, arrow strip, customize. */
.study-grouped-toolbar>.study-reference{flex:0 0 auto;min-width:96px;max-width:min(300px,45%);margin:0 0 0 -6px;padding-left:6px}
.study-reference-button{display:inline-flex;align-items:center;gap:4px;max-width:calc(100% + 6px);min-width:0;margin-right:0;text-align:start}
.study-reference-button strong{display:block;min-width:0;white-space:normal;overflow-wrap:anywhere}
.study-reference small{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.study-reference small{max-width:100%}
.study-grouped-toolbar>.study-actions-menu{align-self:center;position:relative}
.study-grouped-toolbar>.study-actions-menu>summary{display:inline-flex;align-items:center;justify-content:center;min-width:36px;height:36px;padding:8px;border-radius:6px;cursor:pointer;list-style:none}
.study-grouped-toolbar>.study-actions-menu>div{left:0;right:auto}
.study-tools.tb-bar .study-diagram-menu.study-actions-menu>div{width:290px;max-width:min(290px,calc(100vw - 24px))}
.study-grouped-toolbar>[data-tb-item=export-text-work]{margin-left:auto}
.study-format-split{display:inline-flex;align-items:center;border-radius:6px}
.study-format-split>.study-format-main{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:36px;min-width:36px;padding:8px;border-radius:6px 0 0 6px;background:transparent;color:inherit;border:0;cursor:pointer}
.study-format-split>details>summary{display:flex;align-items:center;justify-content:center;box-sizing:border-box;height:36px;min-width:18px;padding:0 2px;border-radius:0 6px 6px 0;cursor:pointer;list-style:none;font-size:11px;opacity:.75}
.study-format-split>details>summary:hover,.study-format-split>.study-format-main:hover{background:var(--hover,#e6ece7)}
.study-format-split>.study-format-main:focus-visible,.study-format-split>details>summary:focus-visible{outline:2px solid var(--focus-ring,#658a6d);outline-offset:2px}
.study-format-split>details>div{left:0;top:100%}
.study-tools [data-study-format-toggle][aria-pressed=true],.study-tools details[data-fmt]>summary[data-state=all]{background:var(--accent-soft,#e9f0ea);color:var(--accent-ink,#36563d)}
.study-tools [data-study-format-toggle][aria-pressed=mixed],.study-tools details[data-fmt]>summary[data-state=some]{box-shadow:inset 0 -3px 0 var(--accent-ink,#36563d);background:color-mix(in srgb,var(--accent-soft,#e9f0ea) 55%,transparent)}
.study-tools [data-study-format-toggle][aria-disabled=true],.study-tools details[data-fmt]>summary[data-state=unavailable]{opacity:.5}
body.app-dark .study-tools [data-study-format-toggle][aria-pressed=true],body.app-dark .study-tools details[data-fmt]>summary[data-state=all]{background:var(--hover,#333a40);color:var(--ink,#f2f3f4)}
.study-grouped-toolbar .tb-fold-panel>.study-format-split{display:flex;width:100%}
.study-grouped-toolbar .tb-fold-panel>.study-format-split>.study-format-main{flex:1;justify-content:flex-start;gap:8px;border-radius:6px}
.study-grouped-toolbar .tb-fold-panel>.study-format-split>details>div{left:auto;right:0}
.study-arrow-tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:0;padding:6px 20px;border-left:0;border-bottom:1px solid var(--line,#e5e5e7)}
.study-arrow-tools .study-arrow-done{margin-left:auto}
.study-arrow-tools .study-arrow-done,.study-arrow-tools .study-arrow-cancel{min-height:32px;padding:4px 14px;border-radius:6px}
.study-arrow-tools .study-arrow-hint{white-space:normal}
.study-customize-done{align-self:flex-end;height:36px;padding:0 18px;border:0;border-radius:6px;background:var(--accent,#3e6246);color:var(--on-accent,#fff);font:600 13px Inter,system-ui;cursor:pointer}
.study-customize-done:focus-visible{outline:2px solid var(--focus-ring,#658a6d);outline-offset:2px}
.study-setting-group>button{display:block;width:100%;margin-top:4px;padding:8px 10px;border-radius:6px;text-align:left;font:14px Inter,system-ui}
.study-grouped-toolbar [inert]{opacity:.45}
@media(pointer:coarse){.study-format-split>.study-format-main,.study-format-split>details>summary,.study-grouped-toolbar>.study-actions-menu>summary,.study-customize-done{min-height:44px;min-width:44px}.study-format-split>details>summary{min-width:36px}}
@media(max-width:520px){.study-grouped-toolbar>.study-tool-group-format{flex:1 1 100%;border-left:0;padding:0}.study-grouped-toolbar>.study-tool-group-annotation,.study-grouped-toolbar>.study-tool-group-view{padding:0 8px}.study-grouped-toolbar>.study-reference{flex:1 1 calc(100% - 52px)}.study-grouped-toolbar>[data-tb-item=export-text-work]{margin-left:0}.study-arrow-tools{padding:6px 12px}}
.study-arrow-tools .study-arrow-done{border:0;background:var(--accent,#3e6246);color:var(--on-accent,#fff);font:600 13px Inter,system-ui;cursor:pointer}
.study-arrow-tools .study-arrow-cancel{border:1px solid var(--line,#d7dad7);background:transparent;color:inherit;cursor:pointer}
.study-arrow-tools .study-arrow-done:focus-visible,.study-arrow-tools .study-arrow-cancel:focus-visible{outline:2px solid var(--focus-ring,#658a6d);outline-offset:2px}
.study-grouped-toolbar>.study-customize-done{background:var(--accent,#3e6246);color:var(--on-accent,#fff)}
.study-grouped-toolbar>.study-actions-menu[open],.study-grouped-toolbar>.study-tool-group:has(details[open]){z-index:60}
.study-grouped-toolbar>.study-actions-menu,.study-grouped-toolbar>.study-tool-group{position:relative}
.study-tool-group-view details>div{max-height:calc(100dvh - 150px);overflow-y:auto}
/* Text Work text boxes: one clear field style in light and dark (the browser's default inset border was showing, and the box ran past its popup's edge). */
:is(#study-root,.study-reference-form) :is(input:not([type=checkbox],[type=radio],[type=color],[type=range],[type=button],[type=submit],.study-heading),textarea,select){box-sizing:border-box;max-width:100%;font:inherit;font-size:15px;line-height:1.4;padding:7px 10px;border:1px solid var(--field-border,#79827b);border-radius:8px;background:#fff;color:#253627;accent-color:var(--accent,#3e6246)}
:is(#study-root,.study-reference-form) :is(input,textarea):not([type=checkbox],[type=radio],[type=color],[type=range],.study-heading)::placeholder{color:#5f6a61;opacity:1}
:is(#study-root,.study-reference-form) :is(input:not([type=checkbox],[type=radio],[type=color],[type=range],.study-heading),textarea,select):focus-visible{outline:2px solid var(--focus-ring,#658a6d);outline-offset:1px;border-color:var(--accent,#3e6246)}
body.app-dark :is(#study-root,.study-reference-form) :is(input:not([type=checkbox],[type=radio],[type=color],[type=range],.study-heading),textarea,select){background:var(--canvas,#191c20)!important;color:var(--ink,#e8e6e1)!important;border-color:#8591a0!important}
body.app-dark :is(#study-root,.study-reference-form) :is(input,textarea):not([type=checkbox],[type=radio],[type=color],[type=range],.study-heading)::placeholder{color:#aab2bd}
body.app-dark :is(#study-root,.study-reference-form) :is(input:not([type=checkbox],[type=radio],[type=color],[type=range],.study-heading),textarea,select):focus-visible{border-color:var(--accent,#9fc3a8)!important;outline-color:var(--accent,#9fc3a8)}
#study-root .study-tools details>div>label>input:not([type=checkbox],[type=color],[type=range]){display:block;width:100%;margin-top:4px}
.colour-row{display:flex;align-items:center;gap:2px}
.colour-menu .colour-row>button:first-child{display:flex;align-items:center;gap:9px;flex:1;min-width:0;width:auto;text-align:start}
.colour-menu .colour-row>.colour-edit{display:flex;align-items:center;justify-content:center;flex:none;width:32px;height:32px;padding:0;opacity:.65}
.colour-menu .colour-row>.colour-edit:hover,.colour-menu .colour-row>.colour-edit:focus-visible{opacity:1}
.colour-edit svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.colour-menu .colour-more{margin:4px 0 0;border-top:1px solid var(--border,#ddd)}
.colour-menu .colour-more>summary{display:flex;align-items:center;gap:9px;box-sizing:border-box;width:100%;height:auto;min-height:32px;padding:4px 10px;margin:0;border:0;border-radius:6px;background:transparent;color:inherit;font:14px Inter,system-ui;cursor:pointer;list-style:none}
.colour-more>summary::-webkit-details-marker{display:none}
.colour-menu .colour-more>summary:hover,.colour-menu .colour-more[open]>summary{background:var(--hover,#e6ece7)}
.colour-more>summary svg{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.colour-more-panel{padding:2px 0 0 10px}
.colour-more-panel>button{display:block;width:100%;text-align:start}
.colour-more-panel .colour-key-toggle{padding-left:10px}
.colour-key-toggle{display:flex!important;align-items:center;justify-content:space-between;gap:12px;min-height:36px;box-sizing:border-box;padding:0 0 0 10px;margin:0;font:14px Inter,system-ui;white-space:nowrap;cursor:pointer}
.colour-key-toggle input{-webkit-appearance:none;appearance:none;flex:none;position:relative;width:32px;height:18px;margin:0;border:0;border-radius:9px;background:#b9c0ba;cursor:pointer;transition:background .15s}
.colour-key-toggle input::after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:7px;background:#fff;transition:transform .15s}
.colour-key-toggle input:checked{background:#58755d}.colour-key-toggle input:checked::after{transform:translateX(14px)}
.colour-key-toggle input:focus-visible{outline:2px solid #58755d;outline-offset:2px}
@media (prefers-reduced-motion:reduce){.colour-key-toggle input,.colour-key-toggle input::after{transition:none}}
#colour-key{position:fixed;right:16px;bottom:16px;z-index:60;display:flex;flex-direction:column;gap:10px;max-height:calc(100vh - 32px);overflow-y:auto}
#colour-key[hidden]{display:none}
.colour-key-card{position:relative;flex:none;width:172px;box-sizing:border-box;padding:6px;border:1px solid #dedfe3;border-radius:10px;background:rgba(255,255,255,.97);color:#24282f;box-shadow:0 4px 14px #0003;font:14px Inter,system-ui}
body.app-dark .colour-key-card{background:rgba(38,43,39,.97);color:#e8ebe8;border-color:#3a413b}
.colour-key-head{display:flex;align-items:center;gap:7px;margin:2px 2px 6px;padding:2px;font-weight:600;font-size:13px;cursor:grab;touch-action:none;user-select:none}
.colour-key-head svg{width:16px;height:16px;fill:none;stroke:#58755d;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
body.app-dark .colour-key-head svg{stroke:#8fb396}
.colour-key-head button{margin-left:auto;border:0;background:transparent;color:inherit;font-size:18px;line-height:1;padding:0 6px;min-height:28px;cursor:pointer}
.colour-key-card .colour-row>button:first-child{display:flex;align-items:center;gap:9px;flex:1;width:100%;min-height:28px;padding:5px 8px;border:0;border-radius:6px;background:transparent;color:inherit;font:inherit;text-align:start;cursor:pointer}
.colour-key-card .colour-row>button:first-child:hover{background:var(--hover,#e6ece7)}
.colour-dialog{border:1px solid #dedfe3;border-radius:12px;padding:18px;max-width:min(360px,calc(100vw - 32px));font:15px Inter,system-ui}
.colour-dialog h2{font-size:17px;margin:0 0 10px}.colour-dialog label{display:block;margin:10px 0;font-size:13px}
.colour-dialog input[type=text]{display:block;width:100%;box-sizing:border-box;margin-top:4px;padding:8px 10px;border:1px solid #c9ccd2;border-radius:6px;font:inherit}
.colour-dialog input[type=color]{display:block;width:64px;height:36px;margin-top:4px;padding:0;border:0;background:transparent}
.colour-dialog-buttons{display:flex;gap:8px;justify-content:flex-end;margin-top:14px;flex-wrap:wrap}
.colour-dialog-buttons button{padding:8px 14px;border-radius:6px;border:1px solid #c9ccd2;background:#fff;font:inherit;cursor:pointer}
.colour-dialog-buttons [type=submit]{background:#58755d;color:#fff;border-color:#58755d}
.colour-dialog-buttons [data-colour-delete]{margin-right:auto;color:#b3261e}
body.app-dark .colour-dialog{background:#262b27;color:#e8ebe8;border-color:#3a413b}body.app-dark .colour-dialog-buttons button:not([type=submit]){background:#333b34;color:#e8ebe8;border-color:#3a413b}
body.app-dark .colour-dialog input[type=text]{background:#1b1f1c;color:#e8ebe8;border-color:#3a413b}
/* Write: a Text color follows the app's dark mode so it stays readable (the saved color is unchanged). */
body.app-dark .tiptap [data-text-color]{color:color-mix(in srgb,var(--tc,#fff) 45%,#fff)!important}
/* Text Work outline window: a large card in the Key cards' style that can be dragged and resized. */
.study-outline-card{position:fixed;z-index:61;display:flex;flex-direction:column;box-sizing:border-box;min-width:260px;min-height:200px;padding:6px;border:1px solid #dedfe3;border-radius:10px;background:#fff;color:#24282f;box-shadow:0 4px 14px #0003;font:14px Inter,system-ui}
.study-outline-card[hidden]{display:none}
body.app-dark .study-outline-card{background:rgba(38,43,39,.97);color:#e8ebe8;border-color:#3a413b}
.study-outline-head{display:flex;align-items:center;gap:7px;flex:none;margin:2px 2px 6px;padding:2px;font-weight:600;font-size:13px;cursor:grab;touch-action:none;user-select:none}
.study-outline-head svg{width:16px;height:16px;fill:none;stroke:#58755d;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
body.app-dark .study-outline-head svg{stroke:#8fb396}
.study-outline-head button{margin-left:auto;border:0;background:transparent;color:inherit;font-size:18px;line-height:1;padding:0 6px;min-height:28px;cursor:pointer}
.study-outline-body{flex:1;min-height:0;overflow-y:auto;padding:0 2px 14px}
.study-outline-empty{margin:8px;color:#5f6a61}
body.app-dark .study-outline-empty{color:#aab2bd}
.study-outline-row{display:flex;align-items:flex-start;gap:4px;padding:3px 0 3px calc(var(--depth,0)*16px)}
.study-outline-mark{flex:none;min-width:2.1em;padding-top:4px;color:#5f6a61;font:600 15px/1.3 Inter,system-ui;text-align:end}
body.app-dark .study-outline-mark{color:#b4bab6}
.study-outline-main{flex:1;min-width:0}
.study-outline-go{flex:none;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:0;border-radius:6px;background:transparent;color:inherit;opacity:.55;cursor:pointer}
.study-outline-go:hover,.study-outline-go:focus-visible{opacity:1;background:var(--hover,#e6ece7)}
.study-outline-go svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.study-outline-card .study-outline-text{display:block;width:100%;box-sizing:border-box;margin:0;padding:3px 6px;border:1px solid transparent;border-radius:6px;background:transparent;color:inherit;font:600 15px/1.3 Inter,system-ui}
.study-outline-card .study-outline-text:hover{border-color:#dedfe3}
.study-outline-card .study-outline-text:focus-visible{outline:2px solid #58755d;outline-offset:1px;border-color:transparent;background:rgba(255,255,255,.6)}
body.app-dark .study-outline-card .study-outline-text:hover{border-color:#3a413b}
body.app-dark .study-outline-card .study-outline-text:focus-visible{outline-color:#8fb396;background:rgba(0,0,0,.2)}




.study-outline-range{display:block;padding:0 7px;font-size:12px;color:#5f6a61;font-variant-numeric:tabular-nums}
body.app-dark .study-outline-range{color:#aab2bd}
.study-outline-grip{position:absolute;right:2px;bottom:2px;width:22px;height:22px;cursor:nwse-resize;touch-action:none;background:linear-gradient(135deg,transparent 0 50%,#8a948c 50% 56%,transparent 56% 66%,#8a948c 66% 72%,transparent 72% 82%,#8a948c 82% 88%,transparent 88%);border-radius:0 0 8px 0}
.study-heading-row.outline-flash{animation:outline-flash 1.4s ease-out}
@keyframes outline-flash{from{background:rgba(88,117,93,.28)}to{background:transparent}}
@media (prefers-reduced-motion:reduce){.study-heading-row.outline-flash{animation:none;background:rgba(88,117,93,.18)}}
/* Dark mode: heading fields sit on the card like plain text, as in light mode; only the focus ring shows. */
body.app-dark #study-outline .study-outline-text{background:transparent!important;border-color:transparent!important;box-shadow:none!important;color:inherit!important}
body.app-dark #study-outline .study-outline-text:hover{border-color:#3a413b!important}
body.app-dark #study-outline .study-outline-text:focus-visible{background:transparent!important;border-color:transparent!important;outline:2px solid #8fb396}
/* Send to Worksheet footer, a lighter dark card, and the grip sits above the footer. */
.study-outline-foot{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:8px 26px 4px 4px;border-top:1px solid #dedfe3}
body.app-dark .study-outline-foot{border-top-color:#566058}
.study-outline-foot select{flex:1 1 120px;min-width:0;max-width:100%;min-height:30px;font:inherit;font-size:13px;color:inherit;background:transparent;border:1px solid #c9ccd1;border-radius:6px;padding:2px 6px}
body.app-dark .study-outline-foot select{border-color:#6a746c;background:#46504a;color:#f0f2ee}
.study-outline-send{flex:none;min-height:30px;padding:3px 10px;border:1px solid #58755d;border-radius:6px;background:#58755d;color:#fff;font:600 13px Inter,system-ui;cursor:pointer}
body.app-dark .study-outline-send{background:#8fb396;border-color:#8fb396;color:#1c2a20}
.study-outline-send[aria-disabled=true]{background:transparent;border-color:#c9ccd1;color:#8a8f96;cursor:not-allowed}
body.app-dark .study-outline-send[aria-disabled=true]{background:transparent;border-color:#6a746c;color:#9aa39c}
.study-outline-note{flex-basis:100%;font-size:12px;color:#58755d;min-height:0}
body.app-dark .study-outline-note{color:#a9cbb0}
body.app-dark .study-outline-card{background:#3e4540;color:#f0f2ee;border-color:#566058}
body.app-dark .study-outline-range,body.app-dark .study-outline-empty{color:#c3cac4}
body.app-dark .study-outline-go:hover,body.app-dark .study-outline-go:focus-visible{background:rgba(255,255,255,.12)}
/* Typing in a heading: a thin ring drawn inside the box, so it never runs past the card. Send to Worksheet opens a list of sections. */
#study-outline .study-outline-text:focus,#study-outline .study-outline-text:focus-visible{outline:0!important;box-shadow:inset 0 0 0 2px #58755d!important;border-color:transparent!important}
body.app-dark #study-outline .study-outline-text:focus,body.app-dark #study-outline .study-outline-text:focus-visible{box-shadow:inset 0 0 0 2px #8fb396!important;outline:0!important}
.study-outline-sendwrap{position:relative;flex:none}
.study-outline-sendmenu{position:absolute;left:0;bottom:calc(100% + 6px);z-index:2;min-width:220px;max-width:min(320px,calc(100vw - 48px));max-height:min(320px,45vh);overflow-y:auto;box-sizing:border-box;padding:4px;border:1px solid #dedfe3;border-radius:8px;background:#fff;color:#24282f;box-shadow:0 4px 14px #0003}
.study-outline-sendmenu[hidden]{display:none}
body.app-dark .study-outline-sendmenu{background:#46504a;color:#f0f2ee;border-color:#6a746c}
.study-outline-sheet>span{display:block;padding:4px 8px 2px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;opacity:.7}
.study-outline-sendmenu button{display:block;width:100%;min-height:32px;padding:5px 8px;border:0;border-radius:6px;background:transparent;color:inherit;font:14px Inter,system-ui;text-align:start;cursor:pointer}
.study-outline-sendmenu button:hover,.study-outline-sendmenu button:focus-visible{background:var(--hover,#e6ece7);outline:0}
body.app-dark .study-outline-sendmenu button:hover,body.app-dark .study-outline-sendmenu button:focus-visible{background:rgba(255,255,255,.14)}
/* Worksheet list: section headings are bold; their questions sit beneath, indented, smaller and lighter. */
.study-outline-sendmenu .study-outline-section{font-weight:700}
.study-outline-sendmenu .study-outline-question{min-height:28px;padding:3px 8px 3px 24px;font-size:13px;font-weight:400;opacity:.85;line-height:1.3}
.study-outline-sendmenu .study-outline-question b{font-weight:600;margin-right:2px}
/* "Show outline" beside the sidebar button, on Write and split screen only. */
.outline-card-toggle{display:none}
body[data-workspace=write] .outline-card-toggle{display:inline-flex}
.outline-card-toggle{align-items:center;gap:4px;white-space:nowrap}
.outline-card-toggle svg{width:18px;height:18px}
@media (max-width:700px){.outline-card-toggle span{display:none}}

/* Text Work comment window: a movable, nonmodal window over the Scripture (no reserved column, so opening it never reflows the text).
   It lives inside .study-body, which clips it to Text Work. On narrow or short screens it becomes a bottom sheet. */
#study-root .study-comment-panel.tw-float{position:absolute;z-index:50;left:0;top:0;right:auto;bottom:auto;flex:none;display:flex;flex-direction:column;width:400px;min-width:0;max-width:calc(100% - 8px);padding:0;overflow:visible;border:1px solid var(--research-line,var(--line,#ddd));border-radius:8px;background:var(--research-paper,var(--panel,#fff));color:var(--research-ink,inherit);box-shadow:0 8px 24px rgba(0,0,0,.14),0 1px 3px rgba(0,0,0,.08)}
#study-root .study-comment-panel.tw-float[hidden]{display:none!important}
#study-root .study-comment-panel.tw-float.tw-front{z-index:70}
body.tw-panel-front #colour-key{z-index:40}
#study-root .study-comment-panel.tw-float.tw-sheet{position:fixed;right:auto;top:auto;max-width:none;z-index:70;border-width:1px 0 0;border-radius:12px 12px 0 0;box-shadow:0 -8px 24px rgba(0,0,0,.16)}
.tw-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.tw-float :is(button,summary,input,select,.tw-head):focus-visible{outline:2px solid var(--focus-ring,#658a6d);outline-offset:1px}
.tw-head{display:flex;align-items:center;gap:2px;flex:none;min-height:44px;padding:4px 6px 4px 4px;border-bottom:1px solid var(--research-line,var(--line,#ddd));cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none}
.tw-sheet .tw-head{cursor:default;touch-action:auto}
.tw-grip{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--research-muted,#6d756f);cursor:grab}
.tw-sheet .tw-grip{display:none}
.tw-grip svg,.tw-float .tw-head svg,.tw-foot svg,.tw-menu svg,.tw-show svg,.tw-review-actions svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.tw-heading{flex:1;margin:0;font:600 14px/1.3 Inter,system-ui,sans-serif}
.tw-head :is(button,summary):not(.tw-grip),.tw-foot button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;min-width:32px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--research-ink,inherit);cursor:pointer;list-style:none}
.tw-delete:hover{color:#b42318}
body.app-dark .tw-delete:hover{color:#fda29b}
.tw-confirm{border:0;background:transparent;color:inherit;font:inherit;font-weight:600;text-decoration:underline;cursor:pointer;min-height:32px}
.tw-head :is(button,summary):hover,.tw-foot button:not(:disabled):hover{background:color-mix(in srgb,var(--research-muted,#6d756f) 16%,transparent)}
.tw-foot button:disabled{opacity:.35;cursor:default}
.tw-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:16px;padding:16px}
.tw-scroll>*{flex:none}
.tw-category{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.tw-category .research-type-picker{position:relative}
.tw-source{display:grid;gap:8px;padding:10px 12px;border:1px solid var(--research-line,#e3e6e2);border-radius:6px;background:color-mix(in srgb,var(--type-color,#6d756f) 6%,transparent);font:13px/1.4 Inter,system-ui,sans-serif}
.tw-source-head{display:flex;align-items:center;gap:8px;min-width:0}
.tw-ref{flex:1;min-width:0;margin:0;font-weight:600;color:var(--research-ink,inherit);overflow-wrap:anywhere}
.tw-source-none .tw-ref{font-weight:500;color:var(--research-muted,#6d756f)}
.tw-show,.tw-more,.tw-review-actions button{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:4px 10px;border:1px solid var(--research-line,#d9ded9);border-radius:6px;background:var(--research-paper,#fff);color:var(--research-ink,inherit);font:500 13px/1.2 Inter,system-ui,sans-serif;cursor:pointer}
.tw-show:hover,.tw-more:hover,.tw-review-actions button:hover{background:color-mix(in srgb,var(--research-muted,#6d756f) 12%,transparent)}
.tw-more{justify-self:start;min-height:28px;border-color:transparent;background:transparent;color:var(--research-muted,#6d756f);padding:2px 6px}
.tw-more[hidden]{display:none}
.tw-excerpt{margin:0;padding:0;font:15px/1.5 var(--research-serif,Georgia,serif);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.tw-excerpt[data-open=true]{display:block;overflow:visible}
.tw-excerpt p{margin:0;overflow-wrap:anywhere}
.tw-review{margin:0;font-weight:600}
.tw-review-actions{display:flex;flex-wrap:wrap;gap:8px}
.tw-deleted{margin:0;padding:8px 12px;border-radius:6px;background:color-mix(in srgb,#b42318 10%,transparent);font:13px/1.4 Inter,system-ui,sans-serif}
.tw-deleted button{border:0;background:transparent;color:inherit;font:inherit;font-weight:600;text-decoration:underline;cursor:pointer;min-height:32px}
html #study-root .tw-float .tw-title-input{display:block;width:100%;box-sizing:border-box;min-height:36px;padding:6px 8px;border:1px solid transparent;border-radius:4px;background:transparent;color:inherit;font:600 15px/1.3 Inter,system-ui,sans-serif}
.tw-title-input::placeholder{color:var(--research-muted,#6d756f);font-weight:500}
html #study-root .tw-float .tw-title-input:hover{border-color:var(--research-line,#d9ded9)}
.tw-format{position:relative;display:flex;align-items:center;gap:4px;min-width:0}
.tw-format .research-format-buttons{flex:1;min-width:0;padding:0}
.tw-format .research-format-menu{position:relative}
.tw-format .research-format-menu>summary{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:6px;list-style:none;cursor:pointer}
.tw-format .research-format-menu>summary::-webkit-details-marker{display:none}
.tw-format .research-format-menu>summary:hover{background:color-mix(in srgb,var(--research-muted,#6d756f) 16%,transparent)}
.tw-format .research-format-menu>summary svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.tw-format-pop{position:absolute;right:0;top:calc(100% + 4px);z-index:5;width:240px;max-width:calc(100vw - 32px);padding:8px;border:1px solid var(--research-line,#dfe4df);border-radius:8px;background:var(--research-paper,#fff);box-shadow:0 8px 24px rgba(0,0,0,.18);display:grid;gap:6px}
.tw-format-pop input{box-sizing:border-box;width:100%;min-height:32px}
.tw-format-pop div{display:flex;flex-direction:column;max-height:200px;overflow:auto}
.tw-format-pop button{min-height:32px;border:0;background:transparent;color:inherit;text-align:start;padding:6px 8px;border-radius:4px;cursor:pointer;font:13px Inter,system-ui,sans-serif}
.tw-format-pop button:hover{background:color-mix(in srgb,var(--research-muted,#6d756f) 14%,transparent)}
.tw-float .research-body{position:relative}
.tw-float .research-body.tw-empty:before{content:attr(data-placeholder);position:absolute;left:0;top:10px;pointer-events:none;color:var(--research-muted,#6d756f);font:17px/1.55 var(--research-serif,Georgia,serif)}
html .tw-float .research-body .tiptap{min-height:min(180px,30vh);padding:10px 0;font-size:17px;line-height:1.55}
html .tw-float .research-body .tiptap p{margin:0 0 .6em}
.tw-details>summary{display:flex;align-items:center;min-height:32px;cursor:pointer;font:500 13px/1.3 Inter,system-ui,sans-serif;color:var(--research-muted,#6d756f)}
.tw-details-body{display:grid;gap:8px;padding-top:8px}
.tw-details .research-meta-row{position:relative}
.tw-foot{display:flex;align-items:center;gap:4px;flex:none;padding:6px 12px 6px 8px;border-top:1px solid var(--research-line,var(--line,#ddd));font:13px/1.3 Inter,system-ui,sans-serif;color:var(--research-muted,#6d756f)}
.tw-count{margin-left:6px;white-space:nowrap}
.tw-save{margin-left:auto;text-align:right;min-width:0}
.tw-save-error{color:#b42318;font-weight:600}
body.app-dark .tw-save-error{color:#fda29b}
@media(pointer:coarse){
 .tw-head :is(button,summary):not(.tw-grip),.tw-foot button,.tw-grip{width:44px;height:44px;min-width:44px}
 .tw-show,.tw-more,.tw-review-actions button,.tw-details>summary,.tw-menu button,.tw-title-input{min-height:44px}
 .tw-format .research-format-menu>summary{width:44px;height:44px}
}

/* The confirm button of a Delete dialog is red, with text that stays readable in light and dark mode. */
html body[data-workspace] .planner-dialog button[type=submit].planner-danger{background:#b42318;border-color:#b42318;color:#fff}
html body[data-workspace] .planner-dialog button[type=submit].planner-danger:is(:hover,:focus-visible):not(:disabled){background:#912018;border-color:#912018;color:#fff}
html body[data-workspace] .planner-dialog button[type=submit].planner-danger:active:not(:disabled){background:#7a1a13;border-color:#7a1a13}
html body.app-dark[data-workspace] .planner-dialog button[type=submit].planner-danger{background:#fda29b;border-color:#fda29b;color:#3a0a06}
html body.app-dark[data-workspace] .planner-dialog button[type=submit].planner-danger:is(:hover,:focus-visible):not(:disabled){background:#fecdca;border-color:#fecdca;color:#3a0a06}
html body.app-dark[data-workspace] .planner-dialog button[type=submit].planner-danger:active:not(:disabled){background:#f97066}
/* Text Work toolbar, two fixed bars. Row 1: passage, undo/redo, annotation and view tools, Export. Row 2: text formatting.
   Nothing floats over the text, so iPad select, copy and paste is never blocked. */
.study-tools.tb-bar.study-grouped-toolbar{align-items:center;gap:6px 8px;padding:8px 16px;min-height:0;container:studytb/inline-size}
.study-grouped-toolbar .study-tool-group-label{display:none}
.study-grouped-toolbar>.study-tool-group{flex-direction:row;align-items:center;padding:0 8px}
.study-grouped-toolbar>.study-tool-group-history{order:1;flex:0 0 auto}
.study-grouped-toolbar>.study-tool-group-annotation{order:2;flex:1 1 0;min-width:0}
.study-grouped-toolbar>[data-tb-item=export-text-work]{order:3;margin-left:auto}
.study-grouped-toolbar>.study-tool-group-format{order:4;flex:0 0 100%;border-left:0;padding:6px 0 0;border-top:1px solid var(--line,#e5e5e7)}
.study-grouped-toolbar .study-tool-group-annotation .study-group-controls{width:100%}
.study-grouped-toolbar .study-tool-group-annotation [data-tb-item=outline]{margin-left:auto}
.study-grouped-toolbar .study-group-controls>.tb-text>.tb-label,.study-grouped-toolbar .study-group-controls>.tb-text>summary>.tb-label{display:inline;white-space:nowrap}
/* Less common words give way first: iPad and narrower keep Label, Note and Arrow. */
@container studytb (max-width:1099px){.study-tools.tb-bar.study-grouped-toolbar .study-group-controls>[data-tb-item=outline] .tb-label,.study-tools.tb-bar.study-grouped-toolbar .study-group-controls>[data-tb-item=annotation-visibility] .tb-label,.study-tools.tb-bar.study-grouped-toolbar .study-group-controls>[data-tb-item=settings] .tb-label,.study-tools.tb-bar.study-grouped-toolbar>[data-tb-item=export-text-work]>.tb-label{display:none}}
/* Phone: passage, undo/redo and Export on the first row; annotation tools and formatting on rows of their own. */
@container studytb (max-width:659px){.study-grouped-toolbar>.study-reference{flex:1 1 0;max-width:none}.study-grouped-toolbar>.study-tool-group-annotation{order:4;flex:0 0 100%;padding:0;border-left:0}.study-grouped-toolbar>.study-tool-group-format{order:5}.study-grouped-toolbar .study-tool-group-annotation [data-tb-item=outline]{margin-left:0}}
@container studytb (max-width:659px){.study-grouped-toolbar .study-tool-group-annotation .study-group-controls>[data-tb-item=settings]{position:static}.study-grouped-toolbar .study-tool-group-annotation .study-group-controls>[data-tb-item=settings]>div{left:auto;right:0;max-width:calc(100vw - 24px)}}

/* Every outline level looks the same (see .study-outline-text); only the Harvard mark and the indent differ. */
.study-reference-form .study-rebase-title{color:#5a6b5c;font-size:14px;margin:0 0 12px}.study-reference-form .study-rebase-keep,.study-reference-form .study-rebase-lost{border-radius:10px;padding:12px 14px;font-size:14px;line-height:1.5;margin:0 0 12px}.study-reference-form .study-rebase-keep{background:#eaf3ec;color:#253627}.study-reference-form .study-rebase-lost{background:#fbefd9;color:#3d2e12}.study-reference-form .study-rebase-note{font-size:13px;opacity:.8}.study-reference-form .study-rebase-buttons{display:flex;gap:10px;justify-content:flex-end;margin-top:14px}.study-reference-form [data-load]{background:#397565;color:#fff;border:0;border-radius:8px;padding:10px 16px}.study-reference-form [data-cancel]{border:1px solid #b9c4ba;background:#fff;color:#253627;border-radius:8px;padding:10px 16px}
body.app-dark .study-reference-form .study-rebase-keep{background:#27352c;color:#e2ece4}body.app-dark .study-reference-form .study-rebase-lost{background:#3d3420;color:#f2e6c8}body.app-dark .study-reference-form [data-cancel]{background:transparent;color:#e8e6e1;border-color:#5b645d}

.study-loading{display:flex;align-items:center;gap:12px;font-size:17px}.study-loading-note{opacity:.7}.study-spinner{width:18px;height:18px;border:3px solid currentColor;border-right-color:transparent;border-radius:50%;opacity:.7;animation:study-spin .9s linear infinite}@keyframes study-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.study-spinner{animation:none}}
