/* V16.1.13 — mobile table navigation */
.cf-bar{position:fixed;left:10px;right:74px;bottom:calc(10px + env(safe-area-inset-bottom,0px));z-index:58;display:none;align-items:center;gap:6px;height:48px;padding:4px;border:1px solid #d5e5dc;border-radius:16px;background:rgba(255,255,255,.96);box-shadow:0 5px 18px #053d3024;direction:rtl;touch-action:manipulation}
.cf-bar.show{display:flex}.cf-bar button{border:0;cursor:pointer;-webkit-tap-highlight-color:transparent}
.cf-bar .cf-prev,.cf-bar .cf-next{flex:0 0 37px;height:38px;border-radius:12px;background:#e8f4ef;color:#075b49;font-size:18px;font-weight:900}
.cf-bar button:disabled{opacity:.3}.cf-bar .cf-pick{flex:1;min-width:0;height:38px;display:flex;align-items:center;gap:6px;padding:2px 10px;text-align:right;border-radius:12px;background:#f6faf8;color:#193c33}
.cf-title{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:8px;flex:1}.cf-title b,.cf-title small{display:block;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cf-title b{font-size:12.5px;font-weight:900}.cf-title small{font-size:10.5px;color:#6b7f78;font-weight:800}.cf-chevron{font-size:16px;color:#64857b;flex:0 0 auto}

.cf-overlay[hidden]{display:none!important}.cf-overlay{position:fixed;inset:0;z-index:200;display:flex;align-items:flex-end;justify-content:center;direction:rtl}.cf-backdrop{position:absolute;inset:0;background:#061b20a6}.cf-dialog{position:relative;width:min(100%,560px);max-height:min(82dvh,750px);display:flex;flex-direction:column;background:#fff;border-radius:24px 24px 0 0;box-shadow:0 -10px 45px #001c1c36;padding-bottom:env(safe-area-inset-bottom,0px);overflow:hidden}
.cf-dialog header{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:18px 18px 14px;border-bottom:1px solid #edf2ef}.cf-dialog header b{display:block;font-size:18px;font-weight:900;color:#134e41}.cf-sheet-subtitle{display:block;margin-top:4px;font-size:11px;font-weight:800;color:#7e928a}.cf-head-actions{display:flex;align-items:center;gap:8px}.cf-close,.cf-search-toggle{border:0;cursor:pointer;-webkit-tap-highlight-color:transparent}
.cf-close{width:42px;height:42px;border-radius:14px;background:#eef3f0;color:#557167;font-size:18px}.cf-search-toggle{min-height:42px;padding:0 12px;border-radius:14px;background:#f4faf7;color:#0b6f59;font-size:12px;font-weight:900;border:1px solid #d8e8e0}.cf-search-toggle.active{background:#0f8269;color:#fff;border-color:#0f8269}
.cf-search-wrap{display:flex;align-items:center;gap:8px;padding:12px 16px 8px}.cf-search{box-sizing:border-box;width:100%;height:43px;border-radius:12px;border:1px solid #dce8e2;background:#f8fbfa;padding:0 14px;text-align:right;font-size:16px;color:#183c34;outline-color:#149474}.cf-clear-search{flex:0 0 auto;height:43px;padding:0 12px;border-radius:12px;border:1px solid #dce8e2;background:#fff;color:#60766e;font-size:12px;font-weight:800}
.cf-shortcuts{display:grid;grid-template-columns:1.45fr 1fr 1fr;gap:7px;padding:0 16px 10px}.cf-shortcuts button{border:0;border-radius:12px;background:#eaf5f0;color:#0b6653;min-height:39px;font-size:12.5px;font-weight:900}.cf-shortcuts .cf-toggle-all{background:#0f8269;color:#fff}
.cf-mode-hint{display:grid;gap:2px;margin:0 16px 10px;padding:11px 13px;border-radius:13px;background:#f6faf8;border:1px solid #dce8e2;color:#35574d;font-size:11.5px;font-weight:800}
.cf-options{overflow-y:auto;overscroll-behavior:contain;padding:2px 12px 16px;min-height:80px}.cf-option{width:100%;display:flex;align-items:center;gap:12px;text-align:right;background:white;border:1px solid #e8efeb;border-radius:15px;padding:12px;min-height:66px;margin-bottom:8px;color:#233d36}.cf-option.selected{background:#eaf7f1;border-color:#16a17d;box-shadow:inset 0 0 0 1px #16a17d22}.cf-option-number{flex:0 0 36px;width:36px;height:36px;border-radius:50%;background:#eef3f0;display:grid;place-items:center;font-size:14px;font-weight:900;color:#407162}.cf-option-details{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}.cf-option-details b{font-size:13.5px;line-height:1.45;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.cf-option-meta{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.cf-option-details small{font-size:11px;color:#778980}.cf-current-badge{display:inline-flex;align-items:center;justify-content:center;min-height:20px;padding:0 8px;border-radius:999px;background:#dff6ec;color:#0c8f68;font-weight:900}.cf-selected-mark{font-size:20px;color:#0d986e}.cf-empty{text-align:center;color:#7d8e85;padding:30px 10px}
body.nv-open .cf-bar{display:none!important}body.cf-on #main-table .tracking-col-head{min-width:0!important;width:auto!important}body.cf-on #main-table tbody td:not(.sticky-col){min-width:0!important;width:auto!important}body.cf-on #tracking-table-scroll{scroll-snap-type:none!important}
body.cf-bar-visible #ws52-scroll-top{bottom:calc(74px + env(safe-area-inset-bottom,0px))!important}
@media(max-width:370px){.cf-bar{left:6px;right:65px;gap:4px}.cf-title b{font-size:11px}.cf-shortcuts{grid-template-columns:1fr 1fr 1fr}.cf-search-toggle{padding:0 10px}}
@media print{.cf-bar,.cf-overlay{display:none!important}}

/* V16.1.11 — direct one/all switch, optional search, and compact list */
@media(max-width:700px){
.cf-bar{left:7px;right:68px;gap:4px;height:49px;padding:4px;border-radius:17px}
.cf-bar .cf-mode{flex:0 0 77px;min-width:0;height:38px;border-radius:11px;background:#e2f3ec;color:#075a48;font-size:10.5px;font-weight:900;line-height:1.15;padding:3px 5px}
.cf-bar.cf-all-mode .cf-mode{background:#08745e;color:#fff}
.cf-bar .cf-prev,.cf-bar .cf-next{flex-basis:32px;height:38px;font-size:17px}
.cf-bar .cf-pick{padding:2px 6px;gap:2px}
.cf-title{display:block}.cf-title b{font-size:11.5px}.cf-title small{font-size:9.5px;margin-top:1px}
.cf-dialog{max-height:min(76dvh,650px);border-radius:22px 22px 0 0}
.cf-dialog header{padding:14px 16px 12px}.cf-dialog header b{font-size:17px}
.cf-option{min-height:55px;padding:9px 12px;margin-bottom:6px;border-radius:13px}
.cf-option-details b{font-size:12.5px;-webkit-line-clamp:2}.cf-option-meta{gap:4px}.cf-option-details small{font-size:10px}
.cf-options{padding:1px 13px 14px}.cf-shortcuts{padding-bottom:8px}
body.cf-sheet-open{overflow:hidden}
}
@media(max-width:370px){.cf-bar{right:61px}.cf-bar .cf-mode{flex-basis:65px;font-size:9.5px}.cf-bar .cf-prev,.cf-bar .cf-next{flex-basis:29px}.cf-title b{font-size:10.5px}}

/* V16.1.11: smaller full-table action, optional search and compact bottom sheet */
.cf-search-wrap[hidden],.cf-mode-hint[hidden]{display:none!important}
@media(max-width:700px){
.cf-bar{bottom:calc(7px + env(safe-area-inset-bottom,0px));height:44px;right:67px;left:8px;border-radius:15px;padding:3px}
.cf-bar .cf-prev,.cf-bar .cf-next{height:36px;flex-basis:31px}
.cf-bar .cf-pick{height:36px}
.cf-bar .cf-mode{height:36px;flex-basis:69px;font-size:10px}
.cf-bar.cf-all-mode{left:auto;right:72px;width:auto;max-width:calc(100vw - 89px);padding:3px;gap:4px;border-radius:13px}
.cf-bar.cf-all-mode .cf-pick{flex:0 1 auto;min-width:0;max-width:145px;padding:1px 7px}
.cf-bar.cf-all-mode .cf-title b{font-size:10px}
.cf-bar.cf-all-mode .cf-title small{display:none}
.cf-bar.cf-all-mode .cf-mode{flex:0 0 69px}
.cf-dialog{max-height:min(67dvh,560px);border-radius:20px 20px 0 0}
.cf-dialog header{padding:11px 14px 10px;align-items:center}
.cf-dialog header b{font-size:16px}
.cf-sheet-subtitle{font-size:10px}
.cf-close{width:36px;height:36px;border-radius:11px}
.cf-search-toggle{min-height:36px;border-radius:11px;padding:0 9px;font-size:11px}
.cf-shortcuts{padding:0 12px 7px;gap:6px}
.cf-shortcuts button{min-height:34px;border-radius:10px;font-size:11px}
.cf-mode-hint{margin:0 12px 6px;padding:6px 9px;font-size:10px}
.cf-options{min-height:0;flex:1;padding:1px 10px 9px}
.cf-option{min-height:48px;padding:7px 10px;gap:8px;margin-bottom:5px;border-radius:12px}
.cf-option-number{flex-basis:29px;width:29px;height:29px;font-size:12px}
.cf-option-details{gap:2px}
.cf-option-details b{font-size:12px;line-height:1.3}
.cf-option-details small{font-size:9.5px}
.cf-current-badge{min-height:17px;font-size:9px;padding:0 6px}
.cf-search-wrap{padding:8px 12px}
.cf-search,.cf-clear-search{height:38px}
body.cf-bar-visible #ws52-scroll-top{bottom:calc(62px + env(safe-area-inset-bottom,0px))!important}
}
@media(max-width:370px){.cf-bar.cf-all-mode{right:66px}.cf-bar .cf-mode{flex-basis:62px}}

/* V16.1.12 — clarity and safe-area refinement: UI only */
@media(max-width:700px){
 .cf-bar{right:79px!important;left:9px!important;gap:4px!important;max-width:none!important;height:44px!important;box-shadow:0 3px 12px #053d301c!important}
 .cf-bar.cf-all-mode{left:auto!important;right:79px!important;width:auto!important;max-width:calc(100vw - 96px)!important}
 .cf-bar .cf-mode{flex:0 0 62px!important;font-size:9.5px!important}
 .cf-bar.cf-all-mode .cf-mode{flex-basis:67px!important}
 .cf-bar .cf-prev,.cf-bar .cf-next{flex:0 0 31px!important}
 .cf-bar .cf-pick{min-width:0!important;padding:2px 5px!important}
 .cf-bar .cf-title b{font-size:11px!important}
 .cf-bar .cf-title small{font-size:9px!important}
 .cf-dialog{max-height:min(63dvh,535px)!important}
 .cf-dialog header{padding:10px 13px 8px!important}
 .cf-shortcuts{padding:0 12px 7px!important}
 .cf-options{min-height:0!important;overflow-y:auto!important;overscroll-behavior:contain!important}
 .cf-option{min-height:49px!important;margin-bottom:5px!important}
 body.cf-sheet-open .cf-bar{visibility:hidden!important}
 body.cf-bar-visible #ws52-scroll-top{bottom:calc(64px + env(safe-area-inset-bottom,0px))!important}
}
@media(max-width:370px){.cf-bar{right:72px!important;left:6px!important}.cf-bar.cf-all-mode{right:72px!important;max-width:calc(100vw - 80px)!important}}


/* V16.1.13 — auto-hide bar with reveal handle */
.cf-handle{position:fixed;left:10px;bottom:calc(12px + env(safe-area-inset-bottom,0px));z-index:59;display:none;align-items:center;justify-content:center;width:40px;height:40px;border:1px solid #d5e5dc;border-radius:14px;background:rgba(255,255,255,.96);box-shadow:0 4px 14px #053d3020;color:#0a5e4b;font-size:22px;font-weight:900;line-height:1;cursor:pointer;-webkit-tap-highlight-color:transparent}
.cf-handle.show{display:flex}
body.cf-sheet-open .cf-handle{display:none!important}
@media(max-width:700px){
  .cf-handle{left:10px;bottom:calc(10px + env(safe-area-inset-bottom,0px));width:42px;height:42px;border-radius:15px}
  body.cf-bar-visible #ws52-scroll-top{bottom:calc(62px + env(safe-area-inset-bottom,0px))!important}
}
@media(max-width:370px){.cf-handle{left:7px;width:39px;height:39px}}
@media print{.cf-handle{display:none!important}}


/* V16.1.14 — softer semi-transparent reveal handle */
.cf-handle{
  border:0!important;
  background:rgba(255,255,255,.28)!important;
  backdrop-filter:blur(7px);
  -webkit-backdrop-filter:blur(7px);
  box-shadow:0 2px 10px rgba(5,61,48,.10)!important;
  color:rgba(10,94,75,.82)!important;
  width:34px!important;
  height:34px!important;
  border-radius:999px!important;
  font-size:24px!important;
  font-weight:900!important;
  line-height:1!important;
  padding:0!important;
  transition:background .18s ease, color .18s ease, transform .18s ease, opacity .18s ease;
}
.cf-handle:hover,.cf-handle:active{background:rgba(255,255,255,.4)!important;color:rgba(10,94,75,.96)!important}
.cf-handle.open{background:rgba(255,255,255,.20)!important;color:rgba(10,94,75,.72)!important;font-size:18px!important}
@media(max-width:700px){
  .cf-handle{left:8px!important;bottom:calc(12px + env(safe-area-inset-bottom,0px))!important;width:35px!important;height:35px!important}
}
@media(max-width:370px){
  .cf-handle{left:6px!important;width:33px!important;height:33px!important;font-size:22px!important}
}


/* V16.1.15 — legible active assignment header ONLY in single-column mobile view.
 * The original DOM, click handlers, scores, and all-column layout stay unchanged. */
@media screen and (max-width:700px) {
  body.cf-on #main-table thead .tracking-col-head,
  body.cf-on #main-table tbody .tracking-score-cell {
    width:auto!important;
    min-width:clamp(145px,43vw,215px)!important;
    max-width:none!important;
  }
  body.cf-on #main-table thead .tracking-col-head {
    box-sizing:border-box!important;
    white-space:normal!important;
    padding:6px 5px!important;
    vertical-align:middle!important;
  }
  body.cf-on #main-table thead .tracking-col-head > div {
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    box-sizing:border-box!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    min-height:78px!important;
    padding:8px 10px!important;
    gap:3px!important;
    text-align:center!important;
  }
  body.cf-on #main-table thead .tracking-col-head > div > span:not(.col-note-dot) {
    display:block!important;
    box-sizing:border-box!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    white-space:normal!important;
    overflow-wrap:break-word!important;
    word-break:normal!important;
    text-align:center!important;
    text-transform:none!important;
  }
  /* Title first, then date, type and deadline. Keep full title readable. */
  body.cf-on #main-table thead .tracking-col-head > div > span:nth-child(2) {
    order:-1;
    color:#087963!important;
    font-family:'Cairo',sans-serif!important;
    font-size:clamp(12px,3.45vw,14px)!important;
    line-height:1.45!important;
    font-weight:900!important;
    unicode-bidi:plaintext;
  }
  body.cf-on #main-table thead .tracking-col-head > div > span:first-child {
    font-size:10px!important;
    line-height:1.45!important;
    font-weight:800!important;
    color:#64748b!important;
    direction:ltr;
    unicode-bidi:isolate;
  }
  body.cf-on #main-table thead .tracking-col-head > div > span:nth-child(n+3):not(.col-note-dot) {
    font-size:10px!important;
    line-height:1.45!important;
    font-weight:800!important;
  }
  body.cf-on #main-table thead .tracking-col-head > div > span.text-amber-600 {
    color:#b45309!important;
  }
}


/* V16.1.16 — separate quiet handle from compact actions; no changes to table data. */
@media screen and (max-width:700px) {
  .cf-bar, .cf-bar.cf-all-mode {
    bottom:calc(9px + env(safe-area-inset-bottom,0px))!important;
    height:43px!important;
    max-width:none!important;
    border-radius:14px!important;
    padding:3px 4px!important;
    gap:4px!important;
    box-sizing:border-box!important;
  }
  .cf-bar {left:48px!important;right:85px!important;width:auto!important;}
  .cf-bar.cf-all-mode {left:auto!important;right:85px!important;width:auto!important;}
  .cf-bar .cf-mode {
    flex:0 0 48px!important;min-width:0!important;max-width:48px!important;
    height:35px!important; padding:3px!important; font-size:10px!important;
    border-radius:10px!important;white-space:normal;
  }
  .cf-bar.cf-all-mode .cf-mode {flex-basis:67px!important;max-width:67px!important;}
  .cf-bar .cf-prev,.cf-bar .cf-next {
    flex:0 0 27px!important;height:35px!important;min-width:0!important;
    border-radius:10px!important;font-size:15px!important;
  }
  .cf-bar .cf-pick {
    flex:1 1 0!important;min-width:0!important;max-width:100%!important;
    height:35px!important;padding:3px 5px!important;overflow:hidden!important;
    border-radius:10px!important;
  }
  .cf-bar.cf-all-mode .cf-pick {flex:0 1 94px!important;min-width:0!important;max-width:94px!important;}
  .cf-bar .cf-title {min-width:0!important;overflow:hidden!important;display:block!important;width:100%!important;direction:rtl;}
  .cf-bar .cf-title b,.cf-bar .cf-title small {
    white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
    max-width:100%!important;display:block!important;
  }
  .cf-bar .cf-title b{font-size:10.5px!important;line-height:1.25!important;}
  .cf-bar .cf-title small{font-size:8px!important;line-height:1.2!important;margin-top:2px!important;}
  .cf-bar .cf-chevron{flex:0 0 auto!important;font-size:12px!important;}
  .cf-handle {direction:ltr!important;unicode-bidi:isolate!important;left:9px!important;bottom:calc(14px + env(safe-area-inset-bottom,0px))!important;}
  body.cf-bar-visible #ws52-scroll-top{bottom:calc(60px + env(safe-area-inset-bottom,0px))!important;}
}
@media screen and (max-width:370px){
  .cf-bar{left:43px!important;right:76px!important;}
  .cf-bar.cf-all-mode{right:76px!important;}
  .cf-bar .cf-mode{flex-basis:44px!important;max-width:44px!important;}
  .cf-bar .cf-prev,.cf-bar .cf-next{flex-basis:25px!important;}
  .cf-handle{left:5px!important;}
}
