/* "הסדר שלי" — מצב שולחן עבודה (assets/js/sd-desk.js). רק במסכים רחבים. */
.dk-toggle[hidden] { display: none !important; }
.dk-toggle { display: inline-flex !important; align-items: center; justify-content: center; }
.dk-toggle svg { width: 20px; height: 20px; }
.dk-toggle[aria-pressed="true"] { background: var(--sd-navy) !important; color: #fff !important; border-color: var(--sd-navy) !important; }

.sd-ses.sd-desk { background: #EEF0F4; }
.sd-ses.sd-desk .sd-ses-top { padding: 8px 14px; background: #fff; }
.sd-ses.sd-desk .sd-ses-tools [data-cmb], .sd-ses.sd-desk .sd-ses-tools [data-desk], .sd-ses.sd-desk .sd-ses-tools [data-panel] { display: none !important; }
.dk-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 68px var(--dk-side, 270px) 8px minmax(0, 1fr) 68px; gap: 0; padding: 8px 0 8px; }
.dk-body.no-side { grid-template-columns: 68px 0 0 minmax(0, 1fr) 68px; }
.dk-body.no-side .dk-side, .dk-body.no-side .dk-split-v { display: none; }

/* סרגלים */
.dk-rail { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 6px; }
.dk-rail button { width: 56px; border: 0; background: transparent; border-radius: 12px; padding: 8px 2px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; color: #3b4255; font: 600 .68rem/1.15 var(--sd-ui); }
.dk-rail button:hover:not(:disabled) { background: #fff; }
.dk-rail button.on { background: #fff; color: var(--sd-primary); box-shadow: 0 1px 0 rgba(21,32,58,.06), 0 4px 12px rgba(21,32,58,.06); }
.dk-rail button:disabled { opacity: .35; cursor: default; }
.dk-rail button[hidden] { display: none; }
.dk-rail button:focus-visible, .dk-side button:focus-visible, .dk-cm button:focus-visible, .dk-split:focus-visible { outline: 3px solid var(--sd-gold); outline-offset: 1px; }
.dk-gap { flex: 1; }

/* חלונית צד */
.dk-side { background: #fff; border: 1px solid #E3E6EC; border-radius: 14px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.dk-side-h, .dk-cm-h { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #EEF0F4; font-size: .9rem; }
.dk-side-h b, .dk-cm-h > b { font-weight: 800; color: var(--sd-navy); }
.dk-side-h b { flex: 1; }
.dk-x { border: 0; background: transparent; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; color: var(--sd-mut); font-size: .85rem; flex: none; }
.dk-x:hover { background: var(--sd-surface); color: var(--sd-ink); }
.dk-side-b { flex: 1; overflow-y: auto; padding: 10px; scrollbar-width: thin; }
.dk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dk-list button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: start; border: 0; background: transparent; border-radius: 10px; padding: 9px 10px; cursor: pointer; color: var(--sd-ink); }
.dk-list button:hover { background: var(--sd-surface); }
.dk-list button.cur { background: #FDF0F4; }
.dk-list i { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 800 .78rem var(--sd-ui); font-style: normal; background: var(--sd-surface); color: var(--sd-mut); }
.dk-list .cur i { background: var(--sd-primary); color: #fff; }
.dk-list .done i { background: var(--sd-green); color: #fff; }
.dk-list span { min-width: 0; display: flex; flex-direction: column; }
.dk-list b { font-size: .92rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-list small { font-size: .74rem; color: var(--sd-mut); }
.dk-note { font-size: .74rem; color: var(--sd-mut); margin: 10px 4px 0; line-height: 1.5; }
.dk-book { padding: 4px 4px 12px; border-bottom: 1px solid #EEF0F4; }
.dk-book > b { display: block; font-size: 1rem; color: var(--sd-navy); }
.dk-book small { display: block; font-size: .76rem; color: var(--sd-mut); margin-top: 2px; }
.dk-prog { display: flex; height: 6px; border-radius: 6px; background: var(--sd-surface); overflow: hidden; margin: 10px 0 4px; }
.dk-prog i { display: block; height: 100%; background: #9fe3c4; } .dk-prog i.add { background: var(--sd-green); }
.dk-sub { font-size: .74rem; font-weight: 800; color: #9a6a08; margin: 12px 4px 6px; }
.dk-toc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.dk-toc button { width: 100%; text-align: start; border: 0; background: transparent; border-radius: 8px; padding: 8px 10px; cursor: pointer; font: 600 .9rem var(--sd-ui); color: var(--sd-ink); }
.dk-toc button:hover { background: var(--sd-surface); }
.dk-toc button.cur { background: var(--sd-gold-soft); color: #7a5306; font-weight: 800; }
.dk-more { margin: 10px 4px 0; border: 1px dashed #d8dce5; background: #fff; border-radius: 10px; padding: 8px 10px; width: calc(100% - 8px); cursor: pointer; font: 700 .84rem var(--sd-ui); color: var(--sd-mut); }
.dk-more:hover { border-color: var(--sd-primary); color: var(--sd-primary); }

/* גבולות נגררים */
.dk-split { position: relative; z-index: 2; }
.dk-split-v { cursor: col-resize; }
.dk-split-h { cursor: row-resize; height: 8px; }
.dk-split::after { content: ""; position: absolute; border-radius: 4px; background: transparent; transition: background .15s; }
.dk-split-v::after { top: 40%; bottom: 40%; left: 2px; right: 2px; }
.dk-split-h::after { left: 45%; right: 45%; top: 2px; bottom: 2px; }
.dk-split:hover::after, .dk-split.drag::after { background: #c6cbd6; }

/* מרכז: טקסט · מפרשים · שורת מיקום */
.dk-center { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) 8px var(--dk-cm, 36%) 32px; }
.dk-body.no-cm .dk-center { grid-template-rows: minmax(0, 1fr) 0 0 32px; }
.dk-body.no-cm .dk-cm, .dk-body.no-cm .dk-split-h { display: none; }
.dk-text { min-height: 0; display: flex; background: #fff; border: 1px solid #E3E6EC; border-radius: 14px; overflow: hidden; }
.dk-text .sd-ses-main { flex: 1; padding: 26px clamp(18px, 3vw, 46px) 40px; scrollbar-width: thin; }
.sd-desk #sdText p[data-li] { border-radius: 6px; transition: background .15s; }
.sd-desk #sdText p.dk-has { cursor: pointer; }
.sd-desk #sdText p.dk-has:hover { background: #FAFBFD; }
.sd-desk #sdText p.dk-sel { background: #FFF8E1; box-shadow: inset -4px 0 0 var(--sd-gold); }
.dk-body.no-cm #sdText p.dk-sel { background: none; box-shadow: none; }
.dk-body.no-cm #sdText p.dk-has { cursor: auto; } .dk-body.no-cm #sdText p.dk-has:hover { background: none; }

.dk-cm { min-height: 0; background: #fff; border: 1px solid #E3E6EC; border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.dk-cm-where { flex: 1; color: var(--sd-mut); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-cm-nav { display: flex; gap: 4px; }
.dk-cm-nav button { width: 30px; height: 28px; border: 1px solid var(--sd-line); background: #fff; border-radius: 8px; cursor: pointer; font-size: 1.1rem; line-height: 1; color: var(--sd-ink); }
.dk-cm-nav button:hover { border-color: var(--sd-navy); }
.dk-cm-in { flex: 1; min-height: 0; display: grid; grid-template-columns: 180px minmax(0, 1fr); }
.dk-cm-pick { border-inline-end: 1px solid #EEF0F4; padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.dk-cm-pick > b { font-size: .8rem; font-weight: 800; color: var(--sd-navy); margin-bottom: 4px; }
.dk-cm-pick button { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 6px 4px; border-radius: 8px; cursor: pointer; font: 600 .9rem var(--sd-ui); color: var(--sd-ink); text-align: start; }
.dk-cm-pick button:hover { background: var(--sd-surface); }
.dk-cm-pick button i { flex: none; width: 18px; height: 18px; border-radius: 5px; border: 2px solid #c6cbd6; display: grid; place-items: center; }
.dk-cm-pick button.on i { background: var(--sd-gold); border-color: var(--sd-gold); }
.dk-cm-pick button.on i::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.dk-cm-pick small { margin-inline-start: auto; font-size: .7rem; font-weight: 800; color: var(--sd-mut); background: var(--sd-surface); border-radius: 999px; padding: 1px 7px; }
.dk-cm-cols { min-height: 0; display: grid; grid-template-columns: repeat(var(--dk-n, 1), minmax(0, 1fr)); }
.dk-col { min-height: 0; display: flex; flex-direction: column; border-inline-start: 1px solid #EEF0F4; }
.dk-col:first-child { border-inline-start: 0; }
.dk-col h3 { margin: 0; padding: 10px 16px 4px; text-align: center; font: 800 1.15rem var(--sd-text); color: var(--sd-navy); }
.dk-col-b { flex: 1; overflow-y: auto; padding: 4px clamp(14px, 2vw, 28px) 18px; font-family: var(--sd-text); font-size: calc(var(--rd-size, 22px) * .82); line-height: 1.75; color: #2B2F3A; text-align: justify; scrollbar-width: thin; }
.dk-col-b p { margin: 0 0 .7em; }
.dk-col-b b { color: #15203A; }
.dk-hint { color: var(--sd-mut); font: 500 .92rem/1.6 var(--sd-ui); padding: 18px; text-align: center; }
.dk-crumb { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px; font-size: .8rem; color: #4a5060; }
.dk-crumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-crumb i { font-style: normal; color: #b0b6c3; margin: 0 4px; }
.dk-crumb small { flex: none; color: var(--sd-mut); font-weight: 700; }
/* המפרשים הרגילים לא מופיעים במצב הזה */
body .sd-desk ~ .cm-pane { display: none !important; }
@media (max-width: 1099px) { .dk-toggle { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .dk-split::after, .sd-desk #sdText p[data-li] { transition: none; } }
/* כפתור המשוב של האתר עובר לסרגל הכלים במצב הזה */
body:has(.sd-desk) .yyfb-tab { display: none; }
/* מיקום קבוע בגריד — כך חלונית סגורה לא מזיזה את השכנות שלה */
.dk-rail-r { grid-column: 1; } .dk-side { grid-column: 2; } .dk-split-v { grid-column: 3; } .dk-center { grid-column: 4; } .dk-rail-l { grid-column: 5; }
.dk-text { grid-row: 1; } .dk-split-h { grid-row: 2; } .dk-cm { grid-row: 3; } .dk-crumb { grid-row: 4; }
.dk-rail-r, .dk-side, .dk-split-v, .dk-center, .dk-rail-l { grid-row: 1; }
