/* SOAP writing and permitted references share one task workspace. */
.note-workspace{--note-header-top:76px;--note-rail-top:164px;min-width:0;color:var(--ink)}
.note-workspace-head{position:sticky;top:var(--note-header-top);z-index:12;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 16px;margin-bottom:14px;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:var(--el-1)}
.note-context{display:grid;gap:2px;min-width:0}.note-context h1{font-size:20px;line-height:1.25;letter-spacing:-.025em;margin:0}.note-context>span{font-size:12px;color:var(--ink-3)}
.note-save-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.note-save-controls .savestate{font-size:12px;max-width:380px}.note-save-controls .btn{min-height:36px}.note-save-controls [hidden]{display:none!important}
.note-workspace .note-layout{display:grid;grid-template-columns:minmax(560px,1fr) minmax(340px,430px)!important;gap:20px;align-items:start}
.note-editor{min-width:0}.note-section-nav{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 9px}.note-section-nav button,.note-reference-tabs button,.note-workspace .note-ref-jump button{font:inherit;font-size:12px;line-height:1.3;min-height:32px;padding:6px 10px;border:1px solid var(--line);border-radius:7px;background:var(--surface);color:var(--ink-2);cursor:pointer}
.note-section-nav button:hover,.note-reference-tabs button:hover,.note-workspace .note-ref-jump button:hover{background:var(--accent-soft);color:var(--accent)}
.note-workspace button:focus-visible{outline:3px solid var(--focus,var(--accent));outline-offset:2px}
.note-workspace .note-sheet{border-radius:12px;box-shadow:none}.note-workspace .sec-head{padding:10px 16px;flex-wrap:wrap;gap:8px;align-items:center}.note-workspace .sec-name{font-size:12px;letter-spacing:.04em}.note-workspace .sec-hint{font-size:11px;line-height:1.4;text-transform:none;letter-spacing:0;flex:1 1 220px;text-align:right}.note-workspace .sec-letter{font-size:18px}
.note-workspace .note-sec textarea{width:100%;min-height:190px;max-height:none;padding:14px 16px;font-size:15px;line-height:1.65;overflow:hidden;resize:none;scroll-margin-top:calc(var(--note-rail-top) + 20px)}
.note-workspace .ap-pair .pair-head{padding:8px 16px;font-size:11px}.note-workspace .ap-lab{display:block;font-size:11px;padding:10px 16px 0}.note-workspace .ap-cols textarea{min-height:100px;padding:10px 16px 14px;font-size:15px;line-height:1.6}.note-workspace .ap-pair:last-child{border-bottom:0}
.note-submit-explanation{font-size:12px;line-height:1.5;margin:12px 2px;color:var(--ink-3)}
.note-reference-panel{position:sticky;top:var(--note-rail-top);min-width:0;height:min(720px,calc(100dvh - var(--note-rail-top) - 20px));min-height:280px;display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line);border-radius:12px;overflow:hidden}
.note-reference-title{display:flex;align-items:baseline;gap:8px;justify-content:space-between;padding:12px 14px 8px}.note-reference-title h2{font-size:15px;margin:0}.note-reference-title span{font-size:11px;color:var(--ink-3)}
.note-reference-tabs{display:flex;flex-wrap:wrap;gap:5px;padding:0 14px 10px;border-bottom:1px solid var(--line)}.note-reference-tabs [aria-selected=true]{background:var(--accent-soft);border-color:var(--accent);color:var(--accent);font-weight:600}
.note-reference-pane{display:flex;flex:1 1 auto;flex-direction:column;min-height:0}.note-reference-pane[hidden]{display:none!important}
.note-reference-content{flex:1 1 auto;min-height:0;overflow:auto;padding:12px 14px;overscroll-behavior:contain;scrollbar-gutter:stable;overflow-wrap:anywhere}
.note-workspace .note-ref-jump{gap:4px;padding:9px 14px;border-bottom:1px solid var(--line-soft)}.note-workspace .note-ref-jump button{font-size:11px;min-height:30px;padding:5px 8px}
.note-workspace .note-ref-body{position:static;max-height:none;scroll-behavior:auto;mask-image:none;-webkit-mask-image:none}.note-workspace .note-ref-body .ew-rec-group{margin:0 0 18px}.note-workspace .note-ref-body .ew-rec-group h3{font-size:14px;margin:0 0 8px}.note-workspace .note-ref-body .ew-rec-row{padding:6px 0}.note-workspace .note-ref-body .ew-rec-row dt{font-size:11px;line-height:1.4}.note-workspace .note-ref-body .ew-rec-row dd{font-size:14px;line-height:1.55}.note-workspace .ew-oldcarts-title{font-size:12px}.note-workspace .ew-oldcarts-empty{font-size:12px}
.note-workspace .chart-grid{grid-template-columns:1fr 1fr;gap:4px 14px}.note-workspace .vital-tile{min-width:0;padding:10px 0}.note-workspace .chart-grid dd{font-size:15px;overflow-wrap:anywhere}.note-reference-content .note-out{font-size:14px;white-space:pre-wrap;margin:0}
.note-reference-caption,.note-restriction{font-size:12px;line-height:1.5;margin:10px 14px;color:var(--ink-3)}.note-reference-content>.note-restriction{margin:14px 0}.note-transcript-row{border-bottom:1px solid var(--line-soft);padding:12px 0}.note-transcript-row:first-child{padding-top:0}.note-transcript-row>div{display:flex;justify-content:space-between;gap:12px;font-size:11px;color:var(--ink-3)}.note-transcript-row p{font-size:14px;line-height:1.55;margin:5px 0 0;white-space:pre-wrap}
.note-mobile-switch{display:none}
@media(max-width:1099px){
 .note-workspace{--note-header-top:70px;--note-rail-top:170px}.note-workspace .note-layout{display:block!important}.note-workspace-head{padding:10px 12px;gap:8px}.note-context h1{font-size:18px}.note-save-controls{gap:7px}.note-save-controls .savestate{font-size:11px;max-width:260px}.note-mobile-switch{display:flex;width:100%;gap:6px}.note-mobile-switch button{flex:1;min-height:36px}.note-mobile-switch [aria-pressed=true]{background:var(--accent-soft);border-color:var(--accent);color:var(--accent);font-weight:600}
 .note-workspace[data-note-view=reference] .note-editor,.note-workspace[data-note-view=write] .note-reference-panel{display:none}
 .note-reference-panel{position:static;height:calc(100dvh - 245px);min-height:360px;max-height:850px}.note-reference-content{padding:14px 18px}.note-reference-title{padding:14px 18px 10px}.note-workspace .note-ref-body .ew-rec-row{grid-template-columns:minmax(100px,25%) minmax(0,1fr);gap:12px}.note-workspace .note-ref-body .ew-rec-row dt{font-size:12px;text-transform:none;letter-spacing:0}.note-workspace .note-ref-body .ew-rec-row dd{font-size:15px}.note-workspace .sec-hint{text-align:left;flex:1 1 100%;margin-left:30px}.note-workspace .note-sec textarea{scroll-margin-top:210px}
}
@media(max-width:599px){.note-workspace{--note-header-top:66px}.note-workspace-head{gap:10px}.note-context{width:100%}.note-save-controls{justify-content:space-between;width:100%}.note-save-controls .savestate{max-width:210px}.note-workspace .note-ref-body .ew-rec-row{grid-template-columns:1fr;gap:3px}.note-reference-panel{min-height:350px;height:calc(100dvh - 265px)}.note-reference-title{align-items:start}.note-reference-title span{max-width:55%;text-align:right}.note-section-nav button{font-size:11px;padding:6px 9px}.note-workspace .sec-hint{font-size:11px}.note-workspace .note-sec textarea{font-size:15px}.note-workspace .ap-cols{grid-template-columns:1fr}}
.note-guide-help{border:1px solid var(--line);border-radius:9px;background:var(--surface);margin:0 0 14px;padding:0 12px}.note-guide-help>summary{font-size:13px;font-weight:600;padding:10px 2px;cursor:pointer;color:var(--ink-2)}.note-guide-help>#encounterGuide{margin:0 0 12px;max-width:none}.note-guide-help[open]>summary{border-bottom:1px solid var(--line-soft);margin-bottom:10px}


/* Tablet editing keeps browser zoom stable and every common reference and
   writing control large enough to tap without losing the current selection. */
@media(pointer:coarse){
 .note-workspace .note-sec textarea,.note-workspace .ap-cols textarea{font-size:16px}
 .note-workspace .note-save-controls .btn,.note-workspace .note-mobile-switch button,
 .note-workspace .note-section-nav button,.note-workspace .note-reference-tabs button,
 .note-workspace .note-ref-jump button{min-height:44px}
 .note-workspace .note-guide-help>summary,.note-workspace .ew-source-detail summary{min-height:44px;padding-top:12px;padding-bottom:12px}
 .note-workspace .note-reference-panel{min-height:360px}
 .note-workspace .note-section-nav{gap:8px}
}
/* A portrait tablet's permitted reference is the active workspace. Page scroll
   remains available; short landscape windows must not squeeze it to a sliver. */
@media(pointer:coarse) and (max-width:1099px){
 .note-workspace .note-reference-panel{height:max(360px,calc(100dvh - var(--note-rail-top) - 20px))}
}
