/* ═══════════ ПАНЕЛЬ ЦЕЛЕЙ (goals drawer) — выезжает справа на ПК (триггер — кнопка в шапке), full-screen на мобиле ═══════════ */
#content{transition:margin-right .28s ease;}
body.goals-open #content{margin-right:calc(var(--goals-width, 320px) + 12px + 16px);}

.goals-drawer{
  position:fixed; top:var(--goals-top, 12px); right:12px; bottom:12px; height:auto; width:var(--goals-width, 320px);
  background:linear-gradient(180deg, var(--card) 0%, var(--bg) 100%);
  border:1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius:16px;
  transform:translateX(calc(100% + 24px)); transition:transform .28s ease; z-index:4500;
  display:flex; flex-direction:column;
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 22%, transparent), 0 10px 40px rgba(0,0,0,0.4);
}
body.goals-open .goals-drawer{transform:translateX(0);}
#goals-toggle-btn.active{color:var(--accent); border-color:var(--accent); background:rgba(124,92,252,0.12);}

.goals-resize-handle{
  position:absolute; left:-4px; top:0; width:8px; height:100%; cursor:ew-resize; z-index:2;
}
.goals-resize-handle:hover, .goals-resize-handle.active{background:rgba(124,92,252,0.25);}

.goals-header{padding:16px 16px 12px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:8px;}
.goals-title{
  font-family:'Rajdhani',sans-serif; font-size:18px; font-weight:700; letter-spacing:1.5px; color:var(--text);
  flex:1; outline:none; cursor:default; padding:2px 4px; border-radius:6px; word-break:break-word;
}
.goals-title[contenteditable="true"]{cursor:text; background:var(--bg); box-shadow:0 0 0 1px var(--accent);}
.goals-pin-btn{
  width:30px; height:30px; border-radius:8px; background:var(--bg); border:1px solid var(--border);
  color:var(--muted); font-size:14px; display:flex; align-items:center; justify-content:center;
  cursor:pointer; flex-shrink:0; transition:all .15s; -webkit-tap-highlight-color:transparent;
}
.goals-pin-btn.active{color:var(--accent); border-color:var(--accent); background:rgba(124,92,252,0.12);}
.goals-close-btn{
  width:30px; height:30px; border-radius:8px; background:var(--bg); border:1px solid var(--border);
  color:var(--muted); font-size:15px; display:none; align-items:center; justify-content:center;
  cursor:pointer; flex-shrink:0; -webkit-tap-highlight-color:transparent;
}

.goals-list{flex:1; overflow-y:auto; padding:8px 0 0;}
.goals-item{display:flex; align-items:center; gap:10px; padding:11px 16px; border-bottom:1px solid rgba(255,255,255,0.12); user-select:none;}
.goals-item.done .goals-item-text{color:var(--done-text); text-decoration:line-through;}
.goals-item-text{flex:1; font-size:14px; color:var(--text); word-break:break-word; line-height:1.4; cursor:default;}
.goals-item-edit-input{
  width:100%; background:var(--bg); border:1px solid var(--accent); border-radius:6px; color:var(--text);
  font-family:'Inter',sans-serif; font-size:14px; padding:4px 8px; outline:none;
}
.goals-item-del{color:var(--text); font-size:15px; font-weight:700; cursor:pointer; padding:4px; flex-shrink:0; opacity:.75; transition:opacity .15s, color .15s;}
.goals-item-del:hover{opacity:1; color:var(--accent2);}
.goals-checkbox{
  width:20px; height:20px; border-radius:6px; border:2px solid var(--muted); flex-shrink:0; cursor:pointer;
  display:flex; align-items:center; justify-content:center; transition:all .15s;
}
.goals-item.done .goals-checkbox{background:var(--accent); border-color:var(--accent);}
.goals-item.done .goals-checkbox::after{content:'✓'; color:white; font-size:12px; font-weight:700;}

.goals-add-wrap{padding:10px 16px 16px; border-top:1px solid var(--border);}
.goals-add-btn{display:flex; align-items:center; gap:8px; padding:10px 4px; color:var(--muted); font-size:13px; cursor:pointer; -webkit-tap-highlight-color:transparent;}
.goals-add-btn:hover{color:var(--accent);}
.goals-add-input-wrap{display:none; gap:8px; align-items:flex-start;}
.goals-add-input-wrap.active{display:flex;}
.goals-add-input{
  flex:1; background:var(--bg); border:1px solid var(--border); border-radius:10px; color:var(--text);
  padding:10px 12px; font-size:14px; font-family:'Inter',sans-serif; outline:none; min-height:20px;
}
.goals-add-input:focus{border-color:var(--accent);}
.goals-add-confirm{background:var(--accent); color:white; border:none; border-radius:8px; padding:0 12px; font-size:13px; font-weight:600; cursor:pointer; height:38px;}

@media (max-width: 768px){
  .goals-drawer{width:100% !important; top:0; left:0; right:0; bottom:0; border-radius:0; border:none; box-shadow:none;}
  .goals-resize-handle{display:none;}
  .goals-pin-btn{display:none;}
  .goals-close-btn{display:flex;}
  body.goals-open #content{margin-right:0;}
}
