/* ===== 바탕화면 '할 일' 위젯 (오른쪽) ===== */
.todo-widget {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 290px;
  background: rgba(30, 34, 42, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  color: #fff;
  user-select: none;
  overflow: hidden;
  /* 화면이 낮으면 머리글은 두고 목록만 스크롤한다 */
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--taskbar-h) - 56px);
}

.todo-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.todo-head-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.todo-head-icon svg {
  width: 18px;
  height: 18px;
}

.todo-head-title {
  font-size: 13px;
  font-weight: 600;
}

.todo-head-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin-left: auto;
}

.todo-toggle {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
  cursor: default;
}

.todo-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}

.todo-widget.is-collapsed .todo-body {
  display: none;
}

.todo-body {
  padding: 6px 0 8px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.todo-progress {
  margin: 0 12px 6px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.todo-progress-bar {
  height: 100%;
  background: #8fc3ff;
  transition: width 200ms ease;
}

.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 12px;
  cursor: default;
}

.todo-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.todo-check {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #1e222a;
}

.todo-item.is-done .todo-check {
  background: #8fc3ff;
  border-color: #8fc3ff;
}

.todo-text {
  flex: 1 1 auto;
  font-size: 12.5px;
  line-height: 1.4;
}

.todo-item.is-done .todo-text {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: line-through;
}

.todo-item.is-important .todo-text {
  font-weight: 600;
}

.todo-due {
  display: block;
  font-size: 11px;
  color: #ffb37a;
  margin-top: 1px;
}

.todo-item.is-done .todo-due {
  color: rgba(255, 255, 255, 0.4);
}

.todo-foot {
  padding: 6px 12px 2px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  white-space: pre-line;
}

@media (max-width: 720px) {
  .todo-widget {
    top: auto;
    bottom: 12px;
    right: 8px;
    width: 220px;
  }
}

/* 누르면 파일이 열리는 할 일 */
.todo-item.is-link .todo-text { text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
