/* Layout B1: content first, one active surface, existing actions/data retained. */
#modal.f517-drawer{inset:var(--f517-top,0px) 0 auto auto;margin:0 0 0 auto;width:min(760px,100vw);max-width:100vw;height:var(--f517-height,100dvh);max-height:var(--f517-height,100dvh);padding:0;border:0;border-left:1px solid #dce4e9;border-radius:18px 0 0 18px;box-shadow:-12px 0 36px #1836461a;overflow:hidden;background:#fff;color:#19313f}
#modal.f517-drawer[open]{display:flex;flex-direction:column}
#modal.f517-drawer.f517-wide,#modal.f517-drawer.l58-editing{width:min(1060px,100vw)}
#modal.f517-drawer::backdrop,#nf-picker.f517-picker::backdrop{background:rgb(18 35 45 / 25%);backdrop-filter:none}
#modal.f517-drawer>.modal-header{padding:18px 24px;flex-shrink:0;min-height:84px;gap:12px;background:#fff;border-bottom:1px solid #e1e7eb;align-items:center;position:relative;z-index:5}
#modal.f517-drawer .modal-header h2{font-size:23px;line-height:1.2;margin:0;color:#183443;letter-spacing:-.02em;overflow-wrap:anywhere}
#modal.f517-drawer .modal-header small{font-size:12px;color:#5b7180;display:block;margin-top:6px}
#modal.f517-drawer>.modal-body{padding:20px 24px;overflow:auto;flex:1;min-height:0;overscroll-behavior:contain;scroll-padding-block:18px}
#modal.f517-drawer>.modal-footer{padding:14px 24px calc(14px + env(safe-area-inset-bottom));gap:10px;flex-shrink:0;display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;border-top:1px solid #e1e7eb;background:#fff;position:relative}
#modal.f517-drawer [hidden]{display:none!important}
#modal.f517-drawer .btn,#modal.f517-drawer .icon-btn,#nf-picker.f517-picker button{min-height:44px}
#modal.f517-drawer .icon-btn{min-width:44px}
#modal.f517-drawer label{font-size:13px;line-height:1.45;color:#263f4e}
#modal.f517-drawer input:not([type="checkbox"]):not([type="file"]),#modal.f517-drawer select,#modal.f517-drawer textarea{min-height:46px;font-size:15px;border:1px solid #cbd6dd;border-radius:10px;background:#fff;max-width:100%}
#modal.f517-drawer input[readonly]{background:#f3f6f8;color:#5d6f7b}
#modal.f517-drawer textarea{min-height:96px;resize:vertical}
#modal.f517-drawer input[aria-invalid="true"]{border-color:#ab3535}
#modal.f517-drawer .nf-form-grid,#modal.f517-drawer .c12-grid,#modal.f517-drawer .rec49-grid{gap:18px 16px;align-items:start}
#modal.f517-drawer .nf-field>span{font-size:13px;font-weight:600;margin-bottom:7px;text-transform:none;letter-spacing:0}
#modal.f517-drawer .nf-field>small{margin-top:6px;line-height:1.35}
#modal.f517-drawer .nf-relation{min-height:48px;width:100%;padding:11px 12px;border-radius:10px;gap:10px;border-color:#cbd6dd;align-items:center}
#modal.f517-drawer .nf-relation span{min-width:0;overflow-wrap:anywhere}
#modal.f517-drawer .nf-relation svg{width:19px;height:19px;flex-shrink:0}
.f517-context{padding:13px 16px;border:1px solid #d7e5e9;background:#f2f8f9;border-radius:12px;margin:0 0 22px;border-left:3px solid #3b8196}
.f517-context small{display:block;color:#587783;font-size:11px;text-transform:uppercase;letter-spacing:.05em}
.f517-context b{display:block;font-size:15px;margin-top:4px;overflow-wrap:anywhere}
.f517-context span{display:block;font-size:13px;color:#455f6e;margin-top:5px}
.f517-details{border-top:1px solid #e2e8ec;margin-top:22px}
.f517-details>summary{min-height:48px;padding:15px 0;cursor:pointer;font-size:13px;color:#4e6878;font-weight:600}
.f517-details>.f517-section-body{padding:4px 0 14px}
.f517-technical{font-size:12px}
.f517-tech-row{padding:5px 0;color:#5a6b77;border-bottom:1px solid #edf1f4;overflow-wrap:anywhere}
.f517-development{font-size:12px;color:#765422;line-height:1.5;padding:10px 0 0;margin:15px 0 0}
.f517-date{display:block;font-size:11px;line-height:1.4;color:#546d7b;margin-top:5px}
.f517-wide-field{grid-column:1/-1}
#modal.f517-drawer .rec49-partner{margin:0;padding:14px;border:1px solid #d9e3e9;border-radius:12px;min-width:0}
#modal.f517-drawer .c12-body{padding:0;gap:17px}
#modal.f517-drawer .nf-tabs{position:sticky;top:-20px;z-index:3;background:white;padding:8px 0;margin:0 0 18px;flex-wrap:nowrap;overflow-x:auto}
#modal.f517-drawer .nf-tabs>button{min-height:44px;white-space:nowrap;font-size:13px}
#modal.f517-drawer .nf-detail-head{padding:0 0 10px;font-size:11px}
#modal.f517-drawer .nf-detail-head small{font-size:11px;color:#617581}
#modal.f517-drawer .f517-options{border:0;margin:0;position:relative;flex-shrink:0}
#modal.f517-drawer .f517-options>summary{display:flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:8px 11px;border:1px solid #dce4e9;border-radius:10px;font-size:12px;list-style:none;color:#2f5368}
.f517-options summary::-webkit-details-marker{display:none}
.f517-options-body{position:absolute;top:calc(100% + 8px);right:0;min-width:224px;padding:8px;background:white;border:1px solid #d6e1e7;box-shadow:0 8px 22px #102c401c;border-radius:12px;z-index:20;display:grid;gap:5px}
.f517-options-body .btn{justify-content:flex-start;width:100%;text-align:left;white-space:normal;font-size:13px}
#modal.l58-editing .f517-options{display:none}
#nf-picker.f517-picker{inset:var(--f517-top,0px) 0 auto auto;margin:0;width:min(760px,100vw);max-width:100vw;height:var(--f517-height,100dvh);max-height:var(--f517-height,100dvh);border:0;border-left:1px solid #dce4e9;border-radius:18px 0 0 18px;padding:0;overflow:hidden;background:#fff}
#nf-picker.f517-picker.f517-wide{width:min(1060px,100vw)}
#nf-picker.f517-picker[open]{display:flex;flex-direction:column}
#nf-picker.f517-picker>header{padding:18px 24px;display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid #e1e7eb}
#nf-picker.f517-picker>header h3{font-size:21px;margin:0}
#nf-picker.f517-picker>header small{display:block;font-size:12px;margin-top:8px;line-height:1.5}
#nf-picker.f517-picker>.nf-picker-body{flex:1;min-height:0;overflow:auto;padding:20px 24px;overscroll-behavior:contain}
#nf-picker.f517-picker>footer{padding:14px 24px calc(14px + env(safe-area-inset-bottom));border-top:1px solid #e1e7eb;display:flex;gap:8px;flex-wrap:wrap}
#nf-picker.f517-picker .nf-pick-item{width:100%;margin:6px 0;padding:12px;text-align:left;border:1px solid #e1e7eb;border-radius:10px;min-height:64px;gap:10px}
#nf-picker.f517-picker input{font-size:16px;min-height:46px;min-width:0}
#modal.f517-drawer .f517-discard{position:absolute;inset:0;background:rgb(19 38 50 / 25%);z-index:40;display:flex;align-items:center;justify-content:center;padding:20px}
.f517-discard>div{width:100%;max-width:420px;background:#fff;padding:24px;border-radius:16px;box-shadow:0 12px 30px #13273220}
.f517-discard h3{font-size:22px;margin:0 0 12px}
.f517-discard p{font-size:14px;line-height:1.65;color:#4c6574}
.f517-discard-actions{display:flex;flex-direction:column;gap:10px;margin-top:20px}
#modal.f517-drawer :focus-visible,#nf-picker.f517-picker :focus-visible{outline:3px solid #3685a4;outline-offset:3px}
#modal.f517-drawer .l58-grid{min-width:0}
@media(max-width:700px){
 #modal.f517-drawer,#modal.f517-drawer.f517-wide,#modal.f517-drawer.l58-editing,#nf-picker.f517-picker,#nf-picker.f517-picker.f517-wide{width:100vw;border-radius:0;border:0;max-width:100vw}
 #modal.f517-drawer>.modal-header,#nf-picker.f517-picker>header{padding:14px 16px calc(12px + env(safe-area-inset-top));min-height:78px;gap:9px}
 #modal.f517-drawer .modal-header h2{font-size:21px}
 #modal.f517-drawer>.modal-body,#nf-picker.f517-picker>.nf-picker-body{padding:18px 16px}
 #modal.f517-drawer>.modal-footer,#nf-picker.f517-picker>footer{padding:12px 16px calc(12px + env(safe-area-inset-bottom));gap:8px}
 #modal.f517-drawer>.modal-footer>.primary{flex:1}
 #modal.f517-drawer .nf-form-grid,#modal.f517-drawer .c12-grid,#modal.f517-drawer .rec49-grid{grid-template-columns:minmax(0,1fr);gap:16px}
 #modal.f517-drawer input:not([type="checkbox"]),#modal.f517-drawer select,#modal.f517-drawer textarea{font-size:16px}
 #modal.f517-drawer .nf-tabs{top:-18px}
 #modal.f517-drawer .f517-options>summary{font-size:0;width:44px}
 #modal.f517-drawer .f517-options>summary:before{content:'•••';font-size:17px;letter-spacing:1px}
 .f517-options-body{right:-4px}
 #modal.f517-drawer .nf-line{max-width:100%;min-width:0}
}
@media(prefers-reduced-motion:no-preference){#modal.f517-drawer .btn,#nf-picker.f517-picker .nf-pick-item{transition:background-color 120ms ease,border-color 120ms ease}}
@media(prefers-reduced-motion:reduce){#modal.f517-drawer *,#nf-picker.f517-picker *{transition:none!important;animation:none!important;scroll-behavior:auto!important}}
/* Older nf-dialog/picker minimums must not widen the drawer beyond its shared footprint. */
#modal.f517-drawer,#nf-picker.f517-picker{min-width:0;min-height:0;box-sizing:border-box}
#modal.f517-drawer>.modal-body,#nf-picker.f517-picker>.nf-picker-body{max-height:none}
#modal.f517-drawer{width:min(760px,100vw)!important;max-height:var(--f517-height,100dvh)!important}
#modal.f517-drawer.f517-wide,#modal.f517-drawer.l58-editing{width:min(1060px,100vw)!important}
@media(max-width:700px){#modal.f517-drawer,#modal.f517-drawer.f517-wide,#modal.f517-drawer.l58-editing{width:100vw!important}}
/* Field help remains legible without competing with the control. */
#modal.f517-drawer .nf-field>small{font-size:11px;line-height:1.45;color:#597081}
