/* =========================================================
   S Task — Tasks page (list / grid / calendar) + task detail
   Measurements from _capture/06,07,08,18 (*.measure.txt)
   ========================================================= */

/* ---------- toolbar ---------- */
.page-tasks .tk-ptb{position:relative;z-index:3;padding-top:4px}
.page-tasks .tk-ptb h1{margin-top:1px}
.page-tasks .tk-show{min-width:91px;height:34px;padding:0 6px 0 5px;gap:0}
.page-tasks .tk-show .mut{margin-left:3px;max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.page-tasks .tb-btn.ie{width:120px;padding:0 0 0 8px;gap:0}
.page-tasks .tb-btn.ie span{font:500 12px/14px var(--font);color:var(--muted)}
.page-tasks .tb-btn.add{margin-left:0}
.page-tasks .tb-btn.add .ic{width:18px;height:18px}
.page-tasks .tk-calview{width:155px;height:32px;padding:0 0 0 15px;justify-content:space-between}
.page-tasks .tk-calview span{font:400 12px/21px var(--font);color:var(--muted);white-space:pre}
.page-tasks .tk-calview .ic{width:24px;height:24px;color:var(--muted);margin-right:9px}
.page-tasks.tk-v-calendar .tk-ptb{padding-top:2px}

.tk-body{flex:1;min-height:0;display:flex;flex-direction:column;position:relative}

/* ---------- filters side tab + drawer ---------- */
.page-tasks .tk-ftab{width:30px;background:#e8e8e8;border-left:0;padding-top:15px;top:58px;bottom:7px;z-index:4}
.page-tasks .tk-ftab .ic{width:15px;height:15px;color:#000}
.page-tasks .tk-ftab span:last-child{font:400 14px/17px var(--font);margin-top:5px}
.page-tasks .tk-ftab.active{background:#d9f5ec}
.page-tasks .tk-ftab.active .ic{color:var(--green)}
.tk-drawer{position:absolute;top:58px;right:30px;bottom:0;width:389px;background:#fff;border-left:1px solid #ddd;box-shadow:-4px 0 12px rgba(0,0,0,.08);z-index:20;display:flex;flex-direction:column;font-family:var(--font)}
.tk-fd-h{height:69px;flex:none;display:flex;align-items:center;padding:0 10px;border-top:1px solid #ddd;border-bottom:1px solid #ddd}
.tk-fd-h h3{margin:0;font:600 20px/24px var(--font);color:#646464}
.tk-fd-clear{margin-left:auto;font:500 12px/17px var(--font);color:var(--red);padding:0 4px}
.tk-fd-x{width:24px;height:24px;margin-left:8px;color:var(--muted)}
.tk-fd-x .ic{width:18px;height:18px}
.tk-fd-b{flex:1;overflow:auto;padding:4px 10px}
.tk-fd-f{margin-top:14px}
.tk-fd-f label{display:block;font:500 12px/12px var(--font);color:#646464;margin:0 0 6px 2px}
.tk-fd-sel{position:relative}
.tk-fd-sel select{width:100%;height:40px;border:1px solid #ddd;border-radius:4px;padding:0 32px 0 8px;font:400 13px var(--font);color:#333;background:#fff;appearance:none;-webkit-appearance:none;outline:0;cursor:pointer}
.tk-fd-sel select:focus{border-color:var(--green)}
.tk-fd-sel .ic{position:absolute;right:6px;top:8px;width:24px;height:24px;color:#bfbfbf;pointer-events:none}
.tk-fd-f2{height:68px;flex:none;display:flex;align-items:center;gap:20px;padding:0 10px;border-top:1px solid #ddd}
.tk-fd-f2 button{flex:1;height:37px;border-radius:4px;font:400 12px/21px var(--font)}
.tk-fd-save{background:rgba(0,0,0,.12);color:rgba(0,0,0,.26);cursor:default!important}
.tk-fd-go{background:var(--green);color:#fff}
.tk-fd-go:hover{background:var(--green-dark)}

/* ---------- list view ---------- */
.page-tasks .tk-grid{margin:0 46px 0 16px;flex:1}
.tk-dt{table-layout:fixed}
.tk-dt thead th{padding:0 16px 0 0;position:sticky;top:0;border-right:0}
.tk-dt thead th span{display:inline-block}
.tk-dt thead th::after{content:"";position:absolute;right:0;top:8px;width:1px;height:15px;background:#e0e0e0}
.tk-dt thead th.c-more::after,.tk-dt thead th:nth-last-child(2)::after{display:none}
.tk-dt thead th.c-title{padding-left:54px;text-align:left;left:0;z-index:4}
.tk-dt thead th.c-proj{padding-right:44px}
.tk-dt thead th.c-more{right:0;z-index:4;padding:0}
.tk-dt td{padding:0;height:40px;position:relative}
.tk-dt tbody tr:hover td{background:#fafafa}
/* pinned title column */
.tk-dt td.c-title{position:sticky;left:0;z-index:1;text-align:left;padding:0 0 0 54px}
.tk-dt td.c-title .tk-tt{display:inline-block;max-width:435px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle;font:500 14px/20px var(--font);color:var(--text);cursor:pointer}
.tk-dt td.c-title .tk-tt:hover{color:var(--green)}
.tk-drag{position:absolute;left:14px;top:50%;width:16px;height:16px;margin-top:-8px;color:#bfbfbf;opacity:0;cursor:grab}
.tk-hov{position:absolute;left:493px;top:50%;width:24px;height:24px;margin-top:-12px;color:#bfbfbf;opacity:0;cursor:pointer}
.tk-hov:hover{color:var(--muted)}
.tk-dt tr:hover .tk-drag,.tk-dt tr:hover .tk-hov{opacity:1}
/* project */
.tk-projbtn{max-width:146px;height:17px;padding:0 7px;border-radius:4px;font:500 12px/17px var(--font);color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tk-projbtn:hover{background:#efefef}
.tk-projbtn.empty{color:var(--text)}
/* status full cell */
.tk-dt td.c-status{padding:0}
.tk-status{display:block;width:150px;height:39px;border-radius:0}
.tk-status:hover{filter:brightness(.96)}
/* priority full cell */
.tk-prio{width:150px;height:39px;display:flex;align-items:center;justify-content:center;gap:6px;font:400 13px/19px var(--font);padding-right:4px}
.tk-prio .ic{width:14px;height:14px}
.tk-prio:hover{filter:brightness(.98)}
/* dates */
.tk-datebtn{height:17px;padding:0 15px;border-radius:30px;font:500 13px/17px var(--font);color:var(--text);white-space:nowrap}
.tk-datebtn:not(.empty){padding:0}
.tk-datebtn.date-red{color:var(--red)}
.tk-datebtn:hover{text-decoration:underline}
/* sticky more */
.tk-dt td.c-more{position:sticky;right:0;z-index:1;width:40px}
.tk-more{width:37px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--muted)}
.tk-more .ic{width:24px;height:24px}
.tk-more:hover{background:rgba(0,0,0,.04)}
/* add row */
.tk-addrow td{height:41px;text-align:left!important;padding:0!important}
.tk-addrow:hover td{background:#fff!important}
.tk-addwrap{position:sticky;left:0;display:inline-flex;align-items:center;height:40px;padding-left:5px;gap:10px;width:540px}
.tk-addwrap .addbtn{display:inline-flex;align-items:center;gap:10px;font:500 14px/20px var(--font);color:var(--text);cursor:pointer}
.tk-addwrap .ic{width:20px;height:20px;color:var(--blue-link)}
.tk-inline{flex:1;height:30px;border:1px solid var(--green);border-radius:4px;padding:0 10px;font:500 14px var(--font);color:var(--text);outline:0}
.tk-nores{color:var(--muted);font:400 13px var(--font);padding-left:54px}
.tk-norow:hover td{background:#fff!important}

/* ---------- popovers ---------- */
.tk-pop{padding:4px 0}
.tk-menu{min-width:160px;font-family:var(--font)}
.tk-menu .mi.sel{background:#f2fbf8;color:var(--text)}
.tk-menu .mi.danger{color:var(--red)}
.tk-menu .tk-check{color:var(--green);font-weight:700}
.tk-menu .ic{width:16px;height:16px}
.tk-sq{width:12px;height:12px;border-radius:2px;flex:none}
.tk-flag{width:14px!important;height:14px!important}
.tk-dot{width:10px;height:10px;border-radius:50%;flex:none}
.tk-pop-h{padding:6px 12px 6px;font:700 12px/16px var(--font);color:var(--muted);text-transform:none}
.tk-projpop{width:240px}
.tk-pp-search{display:block;width:calc(100% - 16px);margin:4px 8px 6px;height:30px;border:1px solid #ddd;border-radius:4px;padding:0 10px;font:400 13px var(--font);outline:0}
.tk-pp-search:focus{border-color:var(--green)}
.tk-pp-list{max-height:260px;overflow:auto}
.tk-pp-list .tx{overflow:hidden;text-overflow:ellipsis}
.tk-datepop{width:250px;padding:8px 12px 10px;font-family:var(--font)}
.tk-datepop .h{font:700 13px/18px var(--font);color:var(--text-2);margin-bottom:8px}
.tk-datepop input{width:100%;height:34px;border:1px solid #ddd;border-radius:4px;padding:0 8px;font:500 13px var(--font);color:var(--text);outline:0}
.tk-datepop input:focus{border-color:var(--green)}
.tk-datepop .quick{display:flex;gap:6px;margin-top:8px}
.tk-datepop .quick button{flex:1;height:26px;border:1px solid #e4e4e4;border-radius:13px;font:500 11px var(--font);color:var(--muted)}
.tk-datepop .quick button:hover{border-color:var(--green);color:var(--green)}
.tk-datepop .ft{display:flex;justify-content:flex-end;gap:8px;margin-top:10px}
.tk-datepop .btn{height:30px;padding:0 14px;font-size:12px}
.tk-morepop{width:260px;padding:0 6px 6px;max-height:340px;overflow:auto}
.tk-morepop .tk-cal-ev{width:100%;margin:0 0 2px;cursor:pointer}
.tk-assignpop .mi .av{font-size:13px}
.tk-confirm{margin:0;font:400 14px/20px var(--font);color:var(--text-2)}

/* ---------- grid view ---------- */
.tk-cards{flex:1;overflow:auto;padding:0 37px 16px 60px;margin-right:0;display:grid;grid-template-columns:repeat(4,384px);gap:16px;align-content:start}
.tk-card{position:relative;height:233px;background:#fff;border-radius:5px;box-shadow:rgba(0,0,0,.07) 0 0 5px -1px,rgba(0,0,0,.06) 0 0 0 1px;padding:15px 20px 0;font-family:var(--font)}
.tk-card:hover{box-shadow:rgba(0,0,0,.12) 0 2px 10px 0,rgba(0,0,0,.06) 0 0 0 1px}
.tk-c-code{margin:0;height:19px;width:260px;font:500 12px/19px var(--font);color:#333}
.tk-c-title{margin:0;height:24px;width:260px;font:600 14px/24px var(--font);color:#333;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.tk-c-title:hover{color:var(--green)}
.tk-c-acts{position:absolute;left:321px;top:34px;display:flex}
.tk-c-acts button{width:24px;height:24px;border-radius:50%;color:#bfbfbf;display:flex;align-items:center;justify-content:center}
.tk-c-acts .ic{width:24px;height:24px}
.tk-c-star .ic{width:17px;height:17px}
.tk-c-star.on{color:#ffc107}
.tk-c-acts button:hover{color:var(--muted)}
.tk-c-proj{display:block;max-width:260px;height:17px;font:500 12px/17px var(--font);color:var(--text);text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-radius:4px}
.tk-c-proj:hover{color:var(--green)}
.tk-c-row{display:flex;align-items:center;margin-top:10px;height:36px}
.tk-c-assign{width:36px;height:36px;border:1px solid #ddd;border-radius:100%;background:#fff;display:flex;align-items:center;justify-content:center;color:rgba(0,0,0,.54)}
.tk-c-assign .ic{width:20px;height:20px}
.tk-c-assign:hover{border-color:var(--green)}
.tk-c-avs{display:inline-flex;margin-left:5px}
.tk-c-avs .av{width:32px;height:32px;font:500 20px/1 var(--font)}
.tk-c-avs .av+.av{margin-left:-8px;border:1.5px solid #fff}
.tk-c-sp{flex:1}
.tk-c-sq{width:34px;height:34px;border:1px solid #ddd;border-radius:4px;background:#fff;display:flex;align-items:center;justify-content:center;margin-left:10px}
.tk-c-sq .ic{width:16px;height:16px}
.tk-c-sq:hover{background:#fafafa}
.tk-c-prog{display:flex;justify-content:space-between;margin-top:20px;height:21px}
.tk-c-prog p{margin:0;font:500 14px/21px var(--font);color:#bfbfbf}
.tk-c-bar{margin-top:5px;height:4px;border-radius:20px;background:#9eebd4;overflow:hidden}
.tk-c-bar span{display:block;height:100%;background:var(--green)}
.tk-c-foot{display:flex;justify-content:space-between;margin-top:15px;height:22px}
.tk-c-foot button{display:flex;align-items:center;gap:5px;color:#bfbfbf;height:22px}
.tk-c-foot .ic{width:22px;height:22px}
.tk-c-foot p{margin:0;font:500 12px/17px var(--font);color:#bfbfbf}
.tk-c-foot p.n{color:var(--muted)}

/* ---------- calendar view ---------- */
.tk-cal{flex:1;overflow:auto;padding:0 30px 16px 60px;font-family:var(--font)}
.tk-cal-tb{display:flex;align-items:center;height:37px;margin-top:-2px}
.tk-cal-today{width:64px;height:37px;border-radius:4px;background:var(--green);color:#fff;font:500 12px/21px var(--font)}
.tk-cal-today:hover{background:var(--green-dark)}
.tk-cal-arrow{width:28px;height:28px;border-radius:50%;color:rgba(0,0,0,.54);display:flex;align-items:center;justify-content:center}
.tk-cal-arrow:first-of-type{margin-left:20px}
.tk-cal-arrow .ic{width:28px;height:28px}
.tk-cal-arrow:hover{background:rgba(0,0,0,.04)}
.tk-cal-title{width:160px;text-align:center;font:500 18px/22px var(--font);color:#000}
.tk-cal-box{margin-top:20px;width:1600px;border:1px solid #eaeaea;background:#fff}
.tk-cal-head{display:grid;grid-template-columns:repeat(7,1fr);height:34px}
.tk-cal-head>div{display:flex;align-items:center;justify-content:center;border-bottom:1px solid #eaeaea}
.tk-cal-head>div+div{border-left:1px solid #eaeaea}
.tk-cal-head span{font:500 10.8px/15px var(--font);color:#bfbfbf}
.tk-cal-row{display:grid;grid-template-columns:repeat(7,1fr);height:106px}
.tk-cal-row+.tk-cal-row{border-top:1px solid #eaeaea}
.tk-cal-cell{position:relative;padding:21px 0 0 1px;overflow:hidden;background:#fff}
.tk-cal-cell+.tk-cal-cell{border-left:1px solid #eaeaea}
.tk-cal-cell.other{background:rgba(221,221,221,.3)}
.tk-cal-cell.other .tk-cal-num{color:#999}
.tk-cal-num{position:absolute;left:7px;top:7px;min-width:14px;height:14px;font:400 12px/14px var(--font);color:#000;text-align:left}
.tk-cal-num:hover{color:var(--green)}
.tk-cal-cell.today .tk-cal-num{color:var(--green);font-weight:700}
.tk-cal-ev{height:24px;margin:0 1px 1px 0;padding:5px 5px 0;color:#fff;cursor:pointer}
.tk-cal-ev div{font:500 10px/14px var(--font);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tk-cal-ev:hover{filter:brightness(.95)}
.tk-cal-more{display:block;height:14px;margin-left:0;padding:0 1px;font:500 10.2px/14px var(--font);color:#000;background:rgba(255,255,255,.3)}
.tk-cal-more:hover{text-decoration:underline}

/* =========================================================
   Task detail dialog
   ========================================================= */
.td-mask{z-index:800}
.td-modal{width:1632px;height:791px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);font-family:var(--font);border-radius:4px}
.td-modal.td-full{width:100vw;height:100vh;max-width:none;max-height:none;border-radius:0}
.td-head{height:40px;flex:none;display:flex;align-items:center;border-bottom:1px solid #f1f1f1;padding:0 10px}
.td-fs{display:flex;align-items:center;height:28px;color:#202020}
.td-fs .ic{width:14px;height:14px;color:#000}
.td-fs span{margin-left:5px;font:500 13px/19px var(--font);color:#202020}
.td-fs:hover span{color:var(--green)}
.td-tools{margin-left:auto;display:flex;align-items:center}
.td-timer{display:flex}
.td-play{width:38px;height:32px;border:1px solid #ddd;border-radius:4px 0 0 4px;display:flex;align-items:center;justify-content:center;color:#4ac076}
.td-play .ic{width:24px;height:24px}
.td-timer.run .td-play{color:var(--red-2)}
.td-timer.run .td-play .ic{width:18px;height:18px}
.td-time{width:102px;height:32px;border:1px solid #ddd;border-left:0;border-radius:0 4px 4px 0;background:#fff;display:flex;align-items:center;padding-left:10px}
.td-time .v{width:65px;text-align:left;font:500 12px/21px var(--font-2);color:#202020}
.td-time .ic{width:24px;height:24px;color:#bfbfbf;margin-left:auto;margin-right:2px}
.td-status{margin-left:10px;width:95px;height:32px;border-radius:4px;color:#fff;font:400 11px/19px var(--font);padding:0 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.td-status:hover{filter:brightness(.95)}
.td-ass{display:flex;align-items:center;margin-left:15px}
.td-addass{width:30px;height:30px;border:1px solid #ddd;border-radius:100%;background:#fff;display:flex;align-items:center;justify-content:center;color:rgba(0,0,0,.54)}
.td-addass .ic{width:20px;height:20px}
.td-addass:hover{border-color:var(--green)}
.td-ass .av{width:28px;height:28px;font:500 17.14px/1 var(--font);margin-left:5px}
.td-ass .av+.av{margin-left:-6px;border:1.5px solid #fff}
.td-divider{width:1px;height:20px;background:#e7e9eb;margin:0 15px}
.td-ib{width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--muted);position:relative}
.td-ib:hover{background:rgba(0,0,0,.04)}
.td-repeat .ic{width:18px;height:18px}
.td-repeat.on{color:var(--green)}
.td-bell{width:32px;height:32px;margin-left:8px}
.td-bell .ic{width:24px;height:24px}
.td-bell .bell-badge{left:15px;top:0;min-width:18px;height:16px;padding:0;font:600 10.2857px/14px var(--font-2)}
.td-dots{width:24px;height:24px;margin-left:5px}
.td-dots .ic{width:24px;height:24px;transform:rotate(90deg)}
.td-x{width:18px;height:18px;margin-left:10px;color:#7f8f9a;display:flex}
.td-x .ic{width:18px;height:18px}
.td-x:hover{color:var(--text)}

.td-body{flex:1;min-height:0;display:flex;background:#f6f6f6}
.td-left{position:relative;flex:1;min-width:0;background:#fff;border-right:1px solid #e7e9eb}
.td-scroll{position:absolute;inset:0;overflow:auto;padding:8px 21px 24px 15px}
.td-scroll::-webkit-scrollbar{width:6px}
.td-scroll::-webkit-scrollbar-thumb{background:rgba(0,0,0,.2);border-radius:3px}
.td-collapse{position:absolute;right:-13px;top:35px;width:24px;height:24px;border:1px solid #e7e9eb;border-radius:50%;background:#fff;color:#929292;display:flex;align-items:center;justify-content:center;z-index:3}
.td-collapse .ic{width:22px;height:22px}
.td-collapse:hover{color:var(--green)}
.td-modal.td-nochat .td-right{display:none}
.td-modal.td-nochat .td-collapse{right:4px}
.td-modal.td-nochat .td-collapse .ic{transform:rotate(180deg)}
.td-meta{font:500 12px/17px var(--font);color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.td-meta b{font-weight:700;margin-left:5px}
.td-title{margin:0;min-height:43px;padding:9px 0 9px;font:600 20px/25px var(--font);color:#333;outline:0;border-radius:4px;word-break:break-word}
.td-title:hover{background:#fafafa}
.td-title:focus{background:#fff;box-shadow:inset 0 0 0 1px var(--green);padding-left:6px}
.td-sf{margin-top:10px;height:32px;border-radius:4px;background:#89a3b2;display:flex;align-items:center;padding:0 10px;cursor:pointer;user-select:none}
.td-sf p{margin:0;font:400 13px/39px var(--font);color:#fff}
.td-sf .td-sf-ic{margin-left:auto;width:20px;height:20px;color:#fff}
.td-modal.td-sf-closed .td-fields{display:none}
.td-fields{display:grid;grid-template-columns:180px 280px 180px 280px;column-gap:8px;row-gap:8px;padding:14px 0 10px 8px;align-items:start}
.td-lbl{height:32px;display:flex;align-items:center;border-radius:4px;min-width:0}
.td-lbl .ic{width:16px;height:16px;color:#505050}
.td-lbl span{margin-left:5px;font:400 13px/19px var(--font);color:#505050;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.td-val{min-height:32px;border-radius:4px;display:flex;align-items:center;font:400 13px/16px var(--font);color:#333;min-width:0}
.td-sel{height:34px;margin-top:-1px;background:#fff;padding:0 4px 0 12px;cursor:pointer;border:1px solid transparent}
.td-sel:hover{border-color:#ddd}
.td-sel>span{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.td-sel .ph{color:#bfbfbf}
.td-sel .td-caret{width:24px;height:24px;color:#bfbfbf}
.td-clr{width:13px;height:13px;color:var(--muted);display:flex;margin-right:0}
.td-clr .ic{width:13px;height:13px}
.td-clr:hover{color:var(--red)}
.td-prio{display:flex;align-items:center;gap:0}
.td-prio .ic{width:16px;height:16px;margin-right:8px}
.td-date{height:32px;padding:0 8px;justify-content:space-between;text-align:left;font:500 13px/17px var(--font);color:#202020}
.td-date.ph{color:var(--muted)}
.td-date:hover{background:#f5f5f5}
.td-date .td-over{width:18px;height:18px;margin-right:10px}
.td-plain{padding:0 7px}
.td-inp{width:100%;height:30px;border:1px solid transparent;border-radius:4px;padding:0;font:400 13px/19px var(--font);color:#333;outline:0;background:transparent}
.td-inp::placeholder{color:var(--muted)}
.td-inp:focus{border-color:#ddd;padding:0 6px;background:#fff}
.td-span2{grid-column:span 2}
.td-desc{grid-column:span 3;display:block;min-height:120px;margin-left:4px;padding:6px 5px;background:#fff;font:400 14px/1.6 var(--font);color:#202020;outline:0;border:1px solid transparent;word-break:break-word}
.td-desc:hover{border-color:#eee}
.td-desc:focus{border-color:#ddd}
.td-desc:empty::before{content:attr(data-ph);color:#bfbfbf}
.td-progress{gap:10px}
.td-progress input[type=range]{-webkit-appearance:none;appearance:none;width:160px;height:4px;border-radius:20px;background:linear-gradient(90deg,var(--green) var(--p,0%),#9eebd4 var(--p,0%));outline:0;cursor:pointer}
.td-progress input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:14px;height:14px;border-radius:50%;background:#fff;border:2px solid var(--green);box-shadow:0 1px 3px rgba(0,0,0,.2)}
.td-progress input[type=range]::-moz-range-thumb{width:12px;height:12px;border-radius:50%;background:#fff;border:2px solid var(--green)}
.td-progress span{font:400 13px/19px var(--font);color:var(--muted)}
.td-wide{grid-column:span 3;padding:0 10px}
.td-todo-in{display:flex;align-items:center;gap:8px}
.td-todo-in input{flex:1;height:34px;border:1px solid #ddd;border-radius:4px;padding:0 12px;font:400 13px var(--font);color:#333;outline:0}
.td-todo-in input:focus{border-color:var(--green)}
.td-todo-in input::placeholder{color:#bfbfbf}
.td-todo-add{width:26px;height:26px;display:flex}
.td-todo-add svg{width:26px;height:26px}
.td-todo-sum{display:flex;align-items:center;gap:14px;margin-top:10px}
.td-todo-sum h6{margin:0;font:700 13px/16px var(--font);color:#333}
.td-todo-sum p{margin:0;font:400 12px/16px var(--font);color:var(--muted)}
.td-todo-bar{flex:1;height:4px;border-radius:20px;background:#e8e8e8;overflow:hidden}
.td-todo-bar span{display:block;height:100%;background:var(--green)}
.td-todo-list{list-style:none;margin:8px 0 0;padding:0}
.td-todo-list li{display:flex;align-items:center;min-height:32px;border-radius:4px;padding:0 6px}
.td-todo-list li:hover{background:#fafafa}
.td-todo-list label{flex:1;display:flex;align-items:center;gap:10px;cursor:pointer;font:400 13px/18px var(--font);color:#333}
.td-todo-list input{width:15px;height:15px;accent-color:var(--green);margin:0}
.td-todo-list li.done span{color:var(--muted);text-decoration:line-through}
.td-todo-list button{width:16px;height:16px;color:#bfbfbf;opacity:0;display:flex}
.td-todo-list button .ic{width:14px;height:14px}
.td-todo-list li:hover button{opacity:1}
.td-todo-list button:hover{color:var(--red)}
.td-assrow{flex-wrap:wrap;gap:6px;grid-column:span 3}
.td-chip{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px 0 3px;border-radius:14px;background:#f3f3f3;font:400 12px var(--font);color:#333}
.td-chip .av{font-size:12px}
.td-addlink{font:500 12px var(--font);color:var(--blue-link);margin-left:4px}

/* right pane */
.td-right{width:653px;flex:none;display:flex;flex-direction:column;background:#f9f9f9;min-height:0}
.td-tabs{height:49px;flex:none;display:flex;background:#fbfbfb;border-bottom:1px solid #ddd}
.td-tab{position:relative;height:48px;flex:none;display:flex;align-items:center;justify-content:center;font:500 12px/21px var(--font-2);color:#333}
.td-tab:nth-child(1){width:145px}.td-tab:nth-child(2){width:149px}.td-tab:nth-child(3){width:135px}.td-tab:nth-child(4){width:115px}.td-tab:nth-child(5){flex:1}
.td-tab.on{color:#202020}
.td-tab.on::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;background:var(--green)}
.td-tab:hover{background:rgba(0,0,0,.02)}
.td-pane{flex:1;min-height:0;display:flex;flex-direction:column}
.td-allh{height:42px;flex:none;display:flex;align-items:center;padding:0 15px;background:#fff;border-bottom:1px solid #ddd}
.td-allh h3{margin:0;font:700 17px/20px var(--font-2);color:#161717}
.td-histbtn{margin-left:auto;width:48px;height:33px;border:1px solid #ddd;border-radius:6px;display:flex;align-items:center;justify-content:center;color:rgba(0,0,0,.54);background:#fff}
.td-histbtn .ic{width:18px;height:18px}
.td-histbtn:hover{background:#fafafa}
.td-chat{flex:1;min-height:0;overflow:auto}
.td-empty{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding-top:30px}
.td-illu{width:176px;height:184px}
.td-empty h4{margin:3px 0 0;font:700 20px/25px var(--font);color:#333}
.td-empty h6{margin:15px 0 0;font:500 14px/22px var(--font);color:#bfbfbf}
.td-empty-s{padding-top:0}
.td-msgs{padding:10px 15px}
.td-daysep{display:flex;align-items:center;margin:8px 0;font:500 11px var(--font);color:var(--muted)}
.td-daysep::before,.td-daysep::after{content:"";flex:1;height:1px;background:#e4e4e4}
.td-daysep span{padding:0 10px}
.td-msg{display:flex;gap:10px;padding:8px 6px;border-radius:6px}
.td-msg:hover{background:#f1f1f1}
.td-msg .av{font-size:17px}
.td-msg-b{flex:1;min-width:0}
.td-msg-h{display:flex;align-items:center;gap:8px}
.td-msg-h b{font:700 13px/18px var(--font);color:#333}
.td-msg-h span{font:400 11px var(--font);color:var(--muted)}
.td-msg-del{margin-left:auto;width:16px;height:16px;color:#bfbfbf;opacity:0;display:flex}
.td-msg-del .ic{width:14px;height:14px}
.td-msg:hover .td-msg-del{opacity:1}
.td-msg-del:hover{color:var(--red)}
.td-msg-t{margin-top:3px;font:400 14px/20px var(--font);color:#202020;word-break:break-word}
.td-comp{flex:none;margin:0 15px 15px;min-height:44px;display:flex;align-items:flex-end;background:#fff;border:1px solid #ddd;border-radius:6px;box-shadow:rgba(0,0,0,.06) 0 2px 8px 0}
.td-comp textarea{flex:1;min-height:42px;max-height:120px;border:0;outline:0;resize:none;padding:11px 0 0 8px;background:transparent;font:500 14px/20px sans-serif;color:#202020;border-radius:6px}
.td-comp textarea::placeholder{color:var(--muted)}
.td-attach{width:36px;height:36px;margin-bottom:3px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#bfbfbf}
.td-attach .ic{width:20px;height:20px}
.td-attach:hover{background:rgba(0,0,0,.04)}
.td-send{width:43px;height:43px;margin-bottom:0;border-radius:50%;display:flex;align-items:center;justify-content:center;color:rgba(0,0,0,.26)}
.td-send .ic{width:27px;height:27px}
.td-send.on{color:var(--green)}
.td-linked{padding:10px 15px}
.td-li{display:flex;align-items:center;gap:10px;height:40px;padding:0 10px;background:#fff;border:1px solid #eee;border-radius:4px;margin-bottom:6px;font:400 13px var(--font);color:#333}
.td-li b{font-weight:700;color:var(--muted)}
.td-li em{margin-left:auto;font-style:normal;color:var(--muted);font-size:12px}
.td-notifpop{width:300px}
.td-np{display:flex;gap:10px;padding:6px 12px 8px}
.td-np p{margin:0;font:400 13px/18px var(--font);color:#333}
.td-np em{display:block;font-style:normal;font-size:11px;color:var(--muted);margin-top:3px}

/* ---------- create task dialog ---------- */
.tk-create .req{color:var(--red)}
.tk-create-2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.tk-create-err{min-height:16px;font:400 12px/16px var(--font);color:var(--red)}
.tk-create .fld select{appearance:auto}

/* =========================================================
   Phones (≤767px) — Tasks page + task detail. Desktop untouched.
   ========================================================= */
@media (max-width: 767px){
  /* ---------- toolbar ---------- */
  .page-tasks .tk-ptb{padding-top:8px}
  .page-tasks .tk-ptb h1{margin-top:0}
  .page-tasks .tk-show{height:36px}
  .page-tasks .tb-btn.ie{width:auto;padding:0 10px 0 8px}
  .page-tasks .tb-btn.add{width:40px;justify-content:center}
  .page-tasks .tk-calview{width:auto;height:36px;gap:4px;padding-left:12px}
  .page-tasks .tk-calview .ic{margin-right:4px}

  /* ---------- filters: side tab hidden by mobile.css -> floating pill; drawer -> full screen ---------- */
  .page-tasks .tk-ftab{display:flex;flex-direction:row;align-items:center;gap:6px;top:auto;right:auto;left:12px;bottom:calc(12px + var(--safe-bottom));width:auto;height:44px;padding:0 16px;border:0;border-radius:22px;background:#fff;box-shadow:0 2px 10px rgba(0,0,0,.18);z-index:5}
  .page-tasks .tk-ftab span{writing-mode:horizontal-tb;margin-top:0}
  .page-tasks .tk-ftab span:last-child{font:500 14px/17px var(--font)}
  .page-tasks .tk-ftab.active{background:#d9f5ec}
  .tk-drawer{position:fixed;inset:0;top:0;right:0;width:100%;border-left:0;box-shadow:none;z-index:60;padding-top:var(--safe-top)}
  .tk-fd-h{height:56px;border-top:0;padding:0 8px 0 16px}
  .tk-fd-h h3{font-size:18px}
  .tk-fd-clear{height:40px;padding:0 10px}
  .tk-fd-x{width:40px;height:40px;margin-left:4px;display:flex;align-items:center;justify-content:center}
  .tk-fd-x .ic{width:22px;height:22px}
  .tk-fd-b{padding:4px 16px 16px}
  .tk-fd-sel select{height:44px}
  .tk-fd-sel .ic{top:10px}
  .tk-fd-f2{height:auto;padding:12px 16px calc(12px + var(--safe-bottom));gap:12px}
  .tk-fd-f2 button{height:44px;font-size:14px}

  /* ---------- list view: narrower pinned title column, sideways scroll ---------- */
  .page-tasks .tk-grid{margin:0;padding-bottom:68px;overflow:auto;-webkit-overflow-scrolling:touch}
  /* colgroup/table widths are inline from COLS: 190+180+150+180+150+188+182+179+40 */
  .tk-dt{width:1439px!important}
  .tk-dt col:first-child{width:190px!important}
  .tk-dt thead th.c-title{padding-left:12px}
  .tk-dt td.c-title{padding:0 8px 0 12px;box-shadow:1px 0 0 #ececec}
  .tk-dt td.c-title .tk-tt{max-width:100%}
  .tk-drag,.tk-hov{display:none}
  .tk-dt td{height:46px}
  .tk-more{height:44px;border-radius:0}
  .tk-status,.tk-prio{height:45px}
  .tk-addrow td{height:48px}
  .tk-addwrap{width:100vw;max-width:100vw;height:46px;padding:0 12px;box-sizing:border-box}
  .tk-addwrap .addbtn{min-height:40px}
  .tk-inline{min-width:0;height:38px}

  /* ---------- grid view: one full-width card per row ---------- */
  .tk-cards{grid-template-columns:minmax(0,1fr);padding:4px 12px calc(16px + var(--safe-bottom));gap:12px;-webkit-overflow-scrolling:touch}
  .tk-card{height:auto;min-height:220px;padding:14px 16px 14px}
  .tk-c-code,.tk-c-title{width:auto;max-width:calc(100% - 64px)}
  .tk-c-proj{max-width:100%}
  .tk-c-acts{left:auto;right:10px;top:28px}
  .tk-c-acts button{width:36px;height:36px}

  /* ---------- calendar view: compact 7-column month ---------- */
  .tk-cal{padding:0 8px calc(16px + var(--safe-bottom))}
  .tk-cal-tb{height:44px;margin-top:4px}
  .tk-cal-today{height:36px}
  .tk-cal-arrow{width:40px;height:40px}
  .tk-cal-arrow:first-of-type{margin-left:8px}
  .tk-cal-title{width:auto;flex:1;min-width:0;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .tk-cal-box{width:auto;margin-top:8px}
  .tk-cal-head{height:28px}
  .tk-cal-head span{font-size:10px}
  .tk-cal-row{height:auto;min-height:64px}
  .tk-cal-cell{min-width:0;padding:20px 0 2px}
  .tk-cal-num{left:3px;top:3px;min-width:20px;height:16px;font-size:11px;line-height:16px}
  .tk-cal-ev{height:15px;margin:0 1px 1px;padding:1px 3px 0;border-radius:2px}
  .tk-cal-ev div{font-size:9px;line-height:13px}
  .tk-cal-more{height:14px;font-size:9px;line-height:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

  /* ---------- task detail: full screen, one scrolling column ---------- */
  .td-mask .td-modal{width:100vw!important;max-width:100vw!important;height:100vh;height:100dvh;max-height:none;border-radius:0;padding-top:var(--safe-top);padding-bottom:0}
  .td-head{position:relative;height:auto;min-height:52px;padding:6px 52px 6px 10px}
  .td-fs,.td-collapse,.td-divider{display:none!important}
  .td-tools{margin-left:0;flex:1;min-width:0;flex-wrap:wrap;row-gap:6px;column-gap:8px}
  .td-play,.td-time{height:36px}
  .td-status{margin-left:0;height:36px}
  .td-ass{margin-left:0}
  .td-addass{width:36px;height:36px}
  .td-ib,.td-bell,.td-dots{width:36px;height:36px;margin-left:0}
  .td-x{position:absolute;right:6px;top:6px;width:40px;height:40px;margin:0;align-items:center;justify-content:center}
  .td-x .ic{width:22px;height:22px}
  .td-body{flex-direction:column;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
  .td-left{flex:none;border-right:0;border-bottom:1px solid #e7e9eb}
  .td-scroll{position:static;overflow:visible;padding:8px 14px 16px}
  .td-modal.td-nochat .td-right{display:flex}
  .td-title{font-size:18px;line-height:24px}
  .td-sf{height:40px}
  .td-fields{grid-template-columns:minmax(0,1fr);row-gap:4px;padding:12px 0 6px}
  .td-fields>*{grid-column:1/-1}
  .td-span2{display:none}
  .td-lbl{height:22px}
  .td-lbl:not(:first-child){margin-top:10px}
  .td-sel{height:42px;margin-top:0;border-color:#ddd}
  .td-date{height:42px;border:1px solid #ddd;background:#fff}
  .td-plain{padding:0}
  .td-inp{height:42px;border-color:#ddd;padding:0 10px;background:#fff}
  .td-inp:focus{padding:0 10px}
  .td-desc{margin-left:0;min-height:110px;border-color:#ddd;font-size:16px}
  .td-progress input[type=range]{flex:1;min-width:0;height:6px}
  .td-wide{padding:0}
  .td-todo-in input{height:42px}
  .td-todo-add{width:40px;height:40px;align-items:center;justify-content:center}
  .td-todo-list button{opacity:1;width:32px;height:32px;align-items:center;justify-content:center}
  .td-assrow{flex-wrap:wrap;gap:6px}
  .td-right{width:auto;flex:none;min-height:0}
  .td-tabs{position:sticky;top:0;z-index:2;overflow-x:auto;scrollbar-width:none}
  .td-tabs::-webkit-scrollbar{display:none}
  .td-tab,.td-tab:nth-child(1),.td-tab:nth-child(2),.td-tab:nth-child(3),.td-tab:nth-child(4),.td-tab:nth-child(5){width:auto;flex:none;padding:0 16px}
  .td-pane{flex:none;min-height:0}
  .td-histbtn{height:36px}
  .td-chat{flex:none;overflow:visible;min-height:200px}
  .td-empty{height:auto;padding:24px 16px}
  .td-illu{width:132px;height:138px}
  .td-empty h4{font-size:17px}
  .td-msgs{padding:10px 12px}
  .td-msg-del{opacity:1;width:32px;height:32px;align-items:center;justify-content:center}
  .td-comp{position:sticky;bottom:0;margin:0 0 0;border-radius:0;border-width:1px 0 0;box-shadow:0 -2px 8px rgba(0,0,0,.06);padding-bottom:var(--safe-bottom);z-index:2}
  .td-attach{width:40px;height:40px}
  .td-li{height:auto;min-height:44px;flex-wrap:wrap;padding:6px 10px}
  .td-notifpop{width:calc(100vw - 16px)}

  /* ---------- create-task dialog ---------- */
  .tk-create-2{grid-template-columns:minmax(0,1fr);gap:0}
}
